From 5e4c7a839d1c0d68a4a518cf2dc8e87925575e58 Mon Sep 17 00:00:00 2001 From: Cupertino Miranda Date: Thu, 16 Mar 2023 08:39:52 +0000 Subject: BPF relocations review / refactoring - Removed not needed relocations. - Renamed relocations to match llvm and linux kernel. Relocation changes: R_BPF_INSN_64 => R_BPF_64_64 R_BPF_INSN_DISP32 => R_BPF_64_32 R_BPF_DATA_32 => R_BPF_64_ABS32 R_BPF_DATA_64 => R_BPF_64_ABS64 ChangeLog: * bfd/bpf-reloc.def: Created file with BPF_HOWTO macro entries. * bfd/reloc.c: Removed non needed relocations. * bfd/bfd-in2.h: regenerated. * bfd/libbfd.h: regenerated. * bfd/elf64-bpf.c: Changed relocations. * include/elf/bpf.h: Adapted relocation values/names. * gas/config/tc-bpf.c: Changed relocation mapping. --- include/elf/bpf.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/elf/bpf.h b/include/elf/bpf.h index e52f481b2be..fb1936010bf 100644 --- a/include/elf/bpf.h +++ b/include/elf/bpf.h @@ -26,20 +26,14 @@ /* Relocations. */ START_RELOC_NUMBERS (elf_bpf_reloc_type) - RELOC_NUMBER (R_BPF_NONE, 0) - RELOC_NUMBER (R_BPF_INSN_64, 1) - RELOC_NUMBER (R_BPF_INSN_32, 2) - RELOC_NUMBER (R_BPF_INSN_16, 3) - RELOC_NUMBER (R_BPF_INSN_DISP16, 4) - RELOC_NUMBER (R_BPF_DATA_8_PCREL, 5) - RELOC_NUMBER (R_BPF_DATA_16_PCREL, 6) - RELOC_NUMBER (R_BPF_DATA_32_PCREL, 7) - RELOC_NUMBER (R_BPF_DATA_8, 8) - RELOC_NUMBER (R_BPF_DATA_16, 9) - RELOC_NUMBER (R_BPF_INSN_DISP32, 10) - RELOC_NUMBER (R_BPF_DATA_32, 11) - RELOC_NUMBER (R_BPF_DATA_64, 12) - RELOC_NUMBER (R_BPF_DATA_64_PCREL, 13) + RELOC_NUMBER (R_BPF_NONE, 0) + RELOC_NUMBER (R_BPF_64_64, 1) + RELOC_NUMBER (R_BPF_64_ABS64, 2) + RELOC_NUMBER (R_BPF_64_ABS32, 3) +/* R_BPF_64_NODYLD32 is not used by GNU tools. + * It is kept in this file to remind that the value is already taken. */ + RELOC_NUMBER (R_BPF_64_NODYLD32, 4) + RELOC_NUMBER (R_BPF_64_32, 10) END_RELOC_NUMBERS (R_BPF_max) #endif /* _ELF_BPF_H */ -- cgit v1.2.1