aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/objtool/include
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2023-05-30 10:21:07 -0700
committerJosh Poimboeuf <jpoimboe@kernel.org>2023-06-07 10:03:22 -0700
commitfcee899d2794319c9dbeb7b877b0c4ac92f5dd16 (patch)
treed5878b621427d0613909257645ded8d0d4efc6f0 /tools/objtool/include
parentobjtool: Get rid of reloc->offset (diff)
downloadwireguard-linux-fcee899d2794319c9dbeb7b877b0c4ac92f5dd16.tar.xz
wireguard-linux-fcee899d2794319c9dbeb7b877b0c4ac92f5dd16.zip
objtool: Get rid of reloc->type
Get the type from the embedded GElf_Rel[a] struct. Link: https://lore.kernel.org/r/d1c1f8da31e4f052a2478aea585fcf355cacc53a.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.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h
index 2070860a099e..41d2149f8bb8 100644
--- a/tools/objtool/include/objtool/elf.h
+++ b/tools/objtool/include/objtool/elf.h
@@ -76,7 +76,6 @@ struct reloc {
struct symbol *sym;
struct list_head sym_reloc_entry;
s64 addend;
- unsigned int type;
bool jump_table_start;
};
@@ -208,6 +207,16 @@ static inline unsigned long reloc_offset(struct reloc *reloc)
return reloc->rel.r_offset;
}
+static inline unsigned int reloc_type(struct reloc *reloc)
+{
+ return GELF_R_TYPE(reloc->rel.r_info);
+}
+
+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);
+}
+
#define for_each_sec(file, sec) \
list_for_each_entry(sec, &file->elf->sections, list)