diff options
| author | Lorenzo Stoakes (ARM) <ljs@kernel.org> | 2026-09-23 18:17:56 +0100 |
|---|---|---|
| committer | Nathan Chancellor <nathan@kernel.org> | 2026-09-26 00:16:35 +0100 |
| commit | 5005f8043c092777b853663845da8facb5eb1385 (patch) | |
| tree | a262da59becd617c133e2a60469b3fdba8ecbafb /tools/lib/python/kdoc | |
| parent | 8050568e0a46f944117970c3969f9316125bc34d (diff) | |
| download | linux-next-5005f8043c092777b853663845da8facb5eb1385.tar.gz linux-next-5005f8043c092777b853663845da8facb5eb1385.zip | |
elf-parse: add section flags, symbol binding and mapping helpers
Extend elf-parse to be able to read the symbol table of vmlinux in
kallsyms.
This requires the ability to open ELF files in read-only mode, so provide
elf_map_ro() to do so.
It also requires accessors for section flags and symbol bindings, so
provide these via shdr_flags() and sym_bind().
It's useful to be able to open an ELF file, map it, and then have easy
access to its section headers, names and symbol table, so introduce struct
elf_file to store this.
In order to obtain this data also provide elf_open_ro() and elf_close().
Also, check for the file being an ELF file first in elf_parse(). This is
the logical thing to check for first, but additionally prevents kallsyms
from having to check this it self.
Assisted-by: LLM
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Link: https://patch.msgid.link/20260923-build-speedup-v4-7-73128809a4a4@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions
