aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/objtool/include
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2023-05-30 10:21:08 -0700
committerJosh Poimboeuf <jpoimboe@kernel.org>2023-06-07 10:03:23 -0700
commit0696b6e314dbe4bd2f24d5e749469f57ea095a9f (patch)
tree8f14e562b2d87c27a829295ca14964f346316132 /tools/objtool/include
parentobjtool: Get rid of reloc->type (diff)
downloadwireguard-linux-0696b6e314dbe4bd2f24d5e749469f57ea095a9f.tar.xz
wireguard-linux-0696b6e314dbe4bd2f24d5e749469f57ea095a9f.zip
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/include')
-rw-r--r--tools/objtool/include/objtool/elf.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h
index 41d2149f8bb8..be08b32a93ee 100644
--- a/tools/objtool/include/objtool/elf.h
+++ b/tools/objtool/include/objtool/elf.h
@@ -75,7 +75,6 @@ struct reloc {
struct section *sec;
struct symbol *sym;
struct list_head sym_reloc_entry;
- s64 addend;
bool jump_table_start;
};
@@ -217,6 +216,11 @@ static inline void set_reloc_type(struct reloc *reloc, int type)
reloc->rel.r_info = GELF_R_INFO(GELF_R_SYM(reloc->rel.r_info), type);
}
+static inline s64 reloc_addend(struct reloc *reloc)
+{
+ return reloc->rela.r_addend;
+}
+
#define for_each_sec(file, sec) \
list_for_each_entry(sec, &file->elf->sections, list)