Skip to content

Commit c144973

Browse files
sathvika-vmpe
authored andcommitted
objtool: Use macros to define arch specific reloc types
Make relocation types architecture specific. Tested-by: Naveen N. Rao <[email protected]> Reviewed-by: Naveen N. Rao <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Signed-off-by: Sathvika Vasireddy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent de6fbce commit c144973

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/objtool/arch/x86/include/arch/elf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
#define _OBJTOOL_ARCH_ELF
33

44
#define R_NONE R_X86_64_NONE
5+
#define R_ABS64 R_X86_64_64
6+
#define R_ABS32 R_X86_64_32
57

68
#endif /* _OBJTOOL_ARCH_ELF */

tools/objtool/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ static int create_mcount_loc_sections(struct objtool_file *file)
885885
memset(loc, 0, addrsize);
886886

887887
if (elf_add_reloc_to_insn(file->elf, sec, idx,
888-
R_X86_64_64,
888+
addrsize == sizeof(u64) ? R_ABS64 : R_ABS32,
889889
insn->sec, insn->offset))
890890
return -1;
891891

0 commit comments

Comments
 (0)