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
This commit is contained in:
Sathvika Vasireddy 2022-11-14 23:27:51 +05:30 committed by Michael Ellerman
parent de6fbcedf5
commit c144973521
2 changed files with 3 additions and 1 deletions

View File

@ -2,5 +2,7 @@
#define _OBJTOOL_ARCH_ELF
#define R_NONE R_X86_64_NONE
#define R_ABS64 R_X86_64_64
#define R_ABS32 R_X86_64_32
#endif /* _OBJTOOL_ARCH_ELF */

View File

@ -885,7 +885,7 @@ static int create_mcount_loc_sections(struct objtool_file *file)
memset(loc, 0, addrsize);
if (elf_add_reloc_to_insn(file->elf, sec, idx,
R_X86_64_64,
addrsize == sizeof(u64) ? R_ABS64 : R_ABS32,
insn->sec, insn->offset))
return -1;