summaryrefslogtreecommitdiff
path: root/tools/objtool/elf.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2025-09-17 09:04:02 -0700
committerJosh Poimboeuf <jpoimboe@kernel.org>2025-10-14 14:50:18 -0700
commit2058f6d1660edc4a9bda9bee627792b352121b10 (patch)
treebd23f987fd9ec958611c1b7767ed453b64246344 /tools/objtool/elf.c
parentebe864b55304f74c4e1a8b6c899e34446b2be424 (diff)
objtool: Refactor prefix symbol creation code
The prefix symbol creation code currently ignores all errors, presumably because some functions don't have the leading NOPs. Shuffle the code around a bit, improve the error handling and document why some errors are ignored. 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/elf.c')
-rw-r--r--tools/objtool/elf.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index e1daae0630be..4bb7ce994b6a 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -942,23 +942,6 @@ struct symbol *elf_create_section_symbol(struct elf *elf, struct section *sec)
return sym;
}
-struct symbol *
-elf_create_prefix_symbol(struct elf *elf, struct symbol *orig, size_t size)
-{
- size_t namelen = strlen(orig->name) + sizeof("__pfx_");
- char name[SYM_NAME_LEN];
- unsigned long offset;
-
- snprintf(name, namelen, "__pfx_%s", orig->name);
-
- offset = orig->sym.st_value - size;
-
- return elf_create_symbol(elf, name, orig->sec,
- GELF_ST_BIND(orig->sym.st_info),
- GELF_ST_TYPE(orig->sym.st_info),
- offset, size);
-}
-
struct reloc *elf_init_reloc(struct elf *elf, struct section *rsec,
unsigned int reloc_idx, unsigned long offset,
struct symbol *sym, s64 addend, unsigned int type)