diff options
| author | Josh Poimboeuf <jpoimboe@kernel.org> | 2025-09-17 09:03:48 -0700 |
|---|---|---|
| committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2025-10-14 14:46:48 -0700 |
| commit | 243e96385368fc5e31da4e9927a201a27a2ae936 (patch) | |
| tree | 187ae5c4b3328b4f5d061e27b2121b0a703c33d6 /tools/objtool/include | |
| parent | dd2c29aafde7653839791d3073515b62e5df1f4d (diff) | |
objtool: Generalize elf_create_section()
In preparation for the objtool klp diff subcommand, broaden the
elf_create_section() interface to give callers more control and reduce
duplication of some subtle setup logic.
While at it, make elf_create_rela_section() global so sections can be
created by the upcoming klp diff code.
Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/include')
| -rw-r--r-- | tools/objtool/include/objtool/elf.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h index c33b8fa0e3ce..badb10926d1e 100644 --- a/tools/objtool/include/objtool/elf.h +++ b/tools/objtool/include/objtool/elf.h @@ -117,11 +117,16 @@ struct elf { struct elf *elf_open_read(const char *name, int flags); struct section *elf_create_section(struct elf *elf, const char *name, - size_t entsize, unsigned int nr); + size_t size, size_t entsize, + unsigned int type, unsigned int align, + unsigned int flags); struct section *elf_create_section_pair(struct elf *elf, const char *name, size_t entsize, unsigned int nr, unsigned int reloc_nr); +struct section *elf_create_rela_section(struct elf *elf, struct section *sec, + unsigned int reloc_nr); + struct symbol *elf_create_symbol(struct elf *elf, const char *name, struct section *sec, unsigned int bind, unsigned int type, unsigned long offset, |
