aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-bpf/reloc-data-le.d
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2020-08-06 15:14:54 +0200
committerJose E. Marchesi <jose.marchesi@oracle.com>2020-08-06 15:14:54 +0200
commit3ee9565c95f49b6f9e80641f6fda51adffc3af1e (patch)
tree5690b3e6eccd1fd4820d9dccba2540138143b3b4 /ld/testsuite/ld-bpf/reloc-data-le.d
parent1a9f72a7a8f445b8d665eb36b053a18e758e63e6 (diff)
downloadgdb-3ee9565c95f49b6f9e80641f6fda51adffc3af1e.zip
gdb-3ee9565c95f49b6f9e80641f6fda51adffc3af1e.tar.gz
gdb-3ee9565c95f49b6f9e80641f6fda51adffc3af1e.tar.bz2
bpf: relocation fixes for eBPF ELF backend
The eBPF ELF backend was not properly recording relocation addends during installation, nor reading and applying them when performing the final relocation. This lead to various issues with incorrect relocations. These issues are fixed with a new howto special function to install the relocations, and updates to bpf_elf_relocate_section to read and use the addends as recorded in the input_bfd. bfd/ChangeLog 2020-08-05 David Faust <david.faust@oracle.com> * elf64-bpf.c (bpf_elf_generic_reloc): New function. (bpf_elf_howto_table): Use it here. (bpf_elf_relocate_section): Use addends recorded in input_bfd for instruction and data relocations. ld/ChangeLog 2020-08-05 David Faust <david.faust@oracle.com> * testsuite/ld-bpf/call-2.s: New file. * testsuite/ld-bpf/call-2.d: Likewise. * testsuite/ld-bpf/reloc-data-be.d: Likewise. * testsuite/ld-bpf/reloc-data-le.d: Likewise. * testsuite/ld-bpf/reloc-data.s: Likewise. * testsuite/ld-bpf/reloc-insn-external-be.d: Likewise. * testsuite/ld-bpf/reloc-insn-external-le.d: Likewise. * testsuite/ld-bpf/reloc-insn-external.s: Likewise. * testsuite/ld-bpf/reloc-insn32-be.d: Likewise. * testsuite/ld-bpf/reloc-insn32-le.d: Likewise. * testsuite/ld-bpf/reloc-insn32.s: Likewise. * testsuite/ld-bpf/reloc-insn64-be.d: Likewise. * testsuite/ld-bpf/reloc-insn64-le.d: Likewise. * testsuite/ld-bpf/reloc-insn64.s: Likewise.
Diffstat (limited to 'ld/testsuite/ld-bpf/reloc-data-le.d')
-rw-r--r--ld/testsuite/ld-bpf/reloc-data-le.d11
1 files changed, 11 insertions, 0 deletions
diff --git a/ld/testsuite/ld-bpf/reloc-data-le.d b/ld/testsuite/ld-bpf/reloc-data-le.d
new file mode 100644
index 0000000..97cb1b3
--- /dev/null
+++ b/ld/testsuite/ld-bpf/reloc-data-le.d
@@ -0,0 +1,11 @@
+#as: --EL
+#source: reloc-data.s
+#objdump: -s
+#ld: -Tdata=0x20 -EL
+#name: data relocs LE
+
+.*: file format .*-bpfle
+
+Contents of section \.data:
+ 0020 666f6f00 62617200 20000000 00000000 .*
+ 0030 28000000 300034 .*