Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool: Use macros to define arch specific reloc types

Make relocation types architecture specific.

Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221114175754.1131267-14-sv@linux.ibm.com

authored by

Sathvika Vasireddy and committed by
Michael Ellerman
c1449735 de6fbced

+3 -1
+2
tools/objtool/arch/x86/include/arch/elf.h
··· 2 2 #define _OBJTOOL_ARCH_ELF 3 3 4 4 #define R_NONE R_X86_64_NONE 5 + #define R_ABS64 R_X86_64_64 6 + #define R_ABS32 R_X86_64_32 5 7 6 8 #endif /* _OBJTOOL_ARCH_ELF */
+1 -1
tools/objtool/check.c
··· 885 885 memset(loc, 0, addrsize); 886 886 887 887 if (elf_add_reloc_to_insn(file->elf, sec, idx, 888 - R_X86_64_64, 888 + addrsize == sizeof(u64) ? R_ABS64 : R_ABS32, 889 889 insn->sec, insn->offset)) 890 890 return -1; 891 891