diff options
author | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-05-30 10:20:57 -0700 |
---|---|---|
committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-06-07 10:03:16 -0700 |
commit | eb0481bbc4ce386e73e28ad8590b4f12c8aded56 (patch) | |
tree | 45ddec66591071900378c3aeef5bc9a7b5ea5add /tools/objtool/include | |
parent | 53257a977a69b5eabbaafb64dcd767d2a4fef2b3 (diff) |
objtool: Fix reloc_hash size
With CONFIG_DEBUG_INFO, DWARF creates a lot of relocations and
reloc_hash is woefully undersized, which can affect performance
significantly. Fix that.
Link: https://lore.kernel.org/r/38ef60dc8043270bf3b9dfd139ae2a30ca3f75cc.1685464332.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/include')
-rw-r--r-- | tools/objtool/include/objtool/elf.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h index 6f82f2515d6b..b81d78b35126 100644 --- a/tools/objtool/include/objtool/elf.h +++ b/tools/objtool/include/objtool/elf.h @@ -90,8 +90,9 @@ struct elf { int fd; bool changed; char *name; - unsigned int text_size, num_files; + unsigned int num_files; struct list_head sections; + unsigned long num_relocs; int symbol_bits; int symbol_name_bits; @@ -158,6 +159,11 @@ static inline size_t elf_rela_size(struct elf *elf) return elf_addr_size(elf) == 4 ? sizeof(Elf32_Rela) : sizeof(Elf64_Rela); } +static inline bool is_reloc_sec(struct section *sec) +{ + return sec->sh.sh_type == SHT_RELA || sec->sh.sh_type == SHT_REL; +} + #define for_each_sec(file, sec) \ list_for_each_entry(sec, &file->elf->sections, list) |