diff options
author | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-05-30 20:21:08 +0300 |
---|---|---|
committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2023-06-07 20:03:23 +0300 |
commit | 0696b6e314dbe4bd2f24d5e749469f57ea095a9f (patch) | |
tree | 8f14e562b2d87c27a829295ca14964f346316132 /tools/objtool/arch | |
parent | fcee899d2794319c9dbeb7b877b0c4ac92f5dd16 (diff) | |
download | linux-0696b6e314dbe4bd2f24d5e749469f57ea095a9f.tar.xz |
objtool: Get rid of reloc->addend
Get the addend from the embedded GElf_Rel[a] struct.
With allyesconfig + CONFIG_DEBUG_INFO:
- Before: peak heap memory consumption: 42.10G
- After: peak heap memory consumption: 40.37G
Link: https://lore.kernel.org/r/ad2354f95d9ddd86094e3f7687acfa0750657784.1685464332.git.jpoimboe@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/arch')
-rw-r--r-- | tools/objtool/arch/x86/decode.c | 4 | ||||
-rw-r--r-- | tools/objtool/arch/x86/special.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index ffb12e83b238..2e1caabecb18 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -623,11 +623,11 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec if (!immr || strcmp(immr->sym->name, "pv_ops")) break; - idx = (immr->addend + 8) / sizeof(void *); + idx = (reloc_addend(immr) + 8) / sizeof(void *); func = disp->sym; if (disp->sym->type == STT_SECTION) - func = find_symbol_by_offset(disp->sym->sec, disp->addend); + func = find_symbol_by_offset(disp->sym->sec, reloc_addend(disp)); if (!func) { WARN("no func for pv_ops[]"); return -1; diff --git a/tools/objtool/arch/x86/special.c b/tools/objtool/arch/x86/special.c index 1a54a249cb50..65f48f35b97e 100644 --- a/tools/objtool/arch/x86/special.c +++ b/tools/objtool/arch/x86/special.c @@ -105,7 +105,7 @@ struct reloc *arch_find_switch_table(struct objtool_file *file, !text_reloc->sym->sec->rodata) return NULL; - table_offset = text_reloc->addend; + table_offset = reloc_addend(text_reloc); table_sec = text_reloc->sym->sec; if (reloc_type(text_reloc) == R_X86_64_PC32) |