]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Accept and ignore the R_BPF_64_NODLYD32 relocation.
authorNick Clifton <nickc@redhat.com>
Mon, 30 Oct 2023 12:17:53 +0000 (12:17 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 30 Oct 2023 12:18:45 +0000 (12:18 +0000)
bfd/ChangeLog
bfd/bpf-reloc.def
include/ChangeLog
include/elf/bpf.h

index 1b9d13add2586c808282cb01aef12829f3af466c..2b12eb35d27ef375fe0aae45ceda474ffda23a01 100644 (file)
@@ -1,3 +1,7 @@
+2023-10-30  Nick Clifton  <nickc@redhat.com>
+
+       * bpf-reloc.def (R_BPF_64_NODLD32): Add entry.
+
 2023-10-16  Nick Clifton  <nickc@redhat.com>
 
        PR 28910
index 31f761d291d80cc2ff5bdeec793d66e21fb6cf66..7e7497892faabfb809bc798b41ff5bcc1f2d9c07 100644 (file)
         0xffff,                /* src_mask */
         0xffff,                /* dst_mask */
         true)                  /* pcrel_offset */
+
+  /* R_BPF_64_NODYLD32 is not used by GNU tools - but it is generated by LLVM.
+     We provide an entry here so that tools like strip can safely handle BPF
+     binaries generated by other tools.  */
+  BPF_HOWTO (R_BPF_64_NODYLD32,        /* type */
+        0,                     /* rightshift */
+        0,                     /* size */
+        0,                     /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_dont, /* complain_on_overflow */
+        bpf_elf_generic_reloc, /* special_function */
+        "R_BPF_64_NODYLD32",   /* name */
+        false,                 /* partial_inplace */
+        0,                     /* src_mask */
+        0,                     /* dst_mask */
+        false)                 /* pcrel_offset */
index 90ee73650c34222e0dccde9a50c6562a79ef3948..e0f0cb3edf400c554f344423708952d516642fac 100644 (file)
@@ -1,3 +1,8 @@
+2023-10-30  Nick Clifton  <nickc@redhat.com>
+
+       * elf/bpf.h (R_BPF_64_NODYLD32): Add a note that this reloc is
+       generated by other tools, eg LLVM.
+
 2023-09-28  Frederic Cambus  <fred@statdns.com>
 
        * elf/common.h (PT_OPENBSD_NOBTCFI): Define.
index e4d416290a7915c1c28b52066f43499a229c84d8..1ad074f3d0e29e91645cdf98ad4dd3a5fb50e7af 100644 (file)
@@ -30,8 +30,8 @@ START_RELOC_NUMBERS (elf_bpf_reloc_type)
   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. */
+/* R_BPF_64_NODYLD32 is not used by GNU tools - but it is generated by LLVM.
  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)
   RELOC_NUMBER (R_BPF_GNU_64_16,                256)