[lld] lld/AArch64: handle more relocation addends (PR #87328)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 17:13:47 PDT 2024


================
@@ -0,0 +1,46 @@
+# REQUIRES: aarch64
+# RUN: yaml2obj %s -o %t.o
+# RUN: ld.lld %t.o -o %t.out
+# RUN: llvm-readelf -x .debug_frame %t.out | FileCheck %s
+
+# CHECK:      Hex dump of section '.debug_frame':
+# CHECK-NEXT: 0x00000000 12480100 ffffcfff 0301736d 63602b00 .H........smc`+.
+# CHECK-NEXT: 0x00000010 019c1e12 1e000700 04011902 07030704 ................
+# CHECK-NEXT: 0x00000020 06050f06 06020708 07050f0a 070b010c ................
+# CHECK-NEXT: 0x00000030 050d080e 010f0710 07110712 08130514 ................
+# CHECK-NEXT: 0x00000040 08150810 08100812 0819081a 091b081c ................
+# CHECK-NEXT: 0x00000050 081d0810 07400041 00420743 03440445 ..... at .A.B.C.D.E
+# CHECK-NEXT: 0x00000060 07460743 08480849 084a084c 084c084d .F.C.H.I.J.L.L.M
+# CHECK-NEXT: 0x00000070 0842084f 02500f51 07520d53 02540556 .B.O.P.Q.R.S.T.V
+# CHECK-NEXT: 0x00000080 01560f56 07580659 095f011b 0650079d .V.V.X.Y._...P..
+# CHECK-NEXT: 0x00000090 020e015f 00000000 14000000 00000000 ..._............
+# CHECK-NEXT: 0x000000a0 00000000 00000000 04000000 00000000 ................
+
+---
+!ELF
+FileHeader:
+  Class: ELFCLASS64
+  Data: ELFDATA2LSB
+  Type: ET_REL
+  Machine: EM_AARCH64
+Sections:
+  - Name: .debug_frame
+    Type: SHT_PROGBITS
+    Content: 12000100FFFFCFFF0301736D63602B00019C1E121E000700040119020703070406050F060602070807050F0A070B010C050D080E010F0710071107120813051408150810081008120819081A091B081C081D08100740004100420743034404450746074308480849084A084C084C084D0842084F02500F5107520D530254055601560F5607580659095F011B0650079D020E015F00000000140000000000000000000000000000000400000000000000
+  - Name: .rel.debug_frame
+    Type: SHT_REL
+    Link: .symtab
+    Info: .debug_frame
+    Relocations:
+      - Symbol: .debug_frame
----------------
MaskRay wrote:

These relocations should have different offsets

https://github.com/llvm/llvm-project/pull/87328


More information about the llvm-commits mailing list