[lld] 2a3fbb6 - [ELF][test] Test .glink code sequence and DT_PPC64_GLINK

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 13:46:25 PDT 2023


Author: Fangrui Song
Date: 2023-04-21T13:46:20-07:00
New Revision: 2a3fbb6bd86bf79c0b3c5b118b4c7128938018ed

URL: https://github.com/llvm/llvm-project/commit/2a3fbb6bd86bf79c0b3c5b118b4c7128938018ed
DIFF: https://github.com/llvm/llvm-project/commit/2a3fbb6bd86bf79c0b3c5b118b4c7128938018ed.diff

LOG: [ELF][test] Test .glink code sequence and DT_PPC64_GLINK

Added: 
    

Modified: 
    lld/test/ELF/ppc64-plt-stub.s

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/ppc64-plt-stub.s b/lld/test/ELF/ppc64-plt-stub.s
index 2f9f4cb5a51d1..76d12d442a165 100644
--- a/lld/test/ELF/ppc64-plt-stub.s
+++ b/lld/test/ELF/ppc64-plt-stub.s
@@ -17,6 +17,7 @@
 ## DT_PLTGOT points to .plt
 # SEC: .plt NOBITS 00000000100303f0 0003f0 000018
 # SEC: 0x0000000000000003 (PLTGOT) 0x100303f0
+# SEC: 0x0000000070000000 (PPC64_GLINK) 0x100102e0
 
 ## .plt[0] holds the address of _dl_runtime_resolve.
 ## .plt[1] holds the link map.
@@ -33,6 +34,25 @@
 # CHECK-NEXT:      mtctr 12
 # CHECK-NEXT:      bctr
 
+# CHECK-LABEL: <.glink>:
+# CHECK-NEXT:  100102c4: mflr 0
+# CHECK-NEXT:            bcl 20, 31, 0x100102cc <.glink+0x8>
+# CHECK-NEXT:            mflr 11
+# CHECK-NEXT:            mtlr 0
+# CHECK-NEXT:            sub     12, 12, 11
+# CHECK-NEXT:            addi 0, 12, -52
+# CHECK-NEXT:            rldicl 0, 0, 62, 2
+# CHECK-NEXT:            ld 12, 44(11)
+# CHECK-NEXT:            add 11, 12, 11
+# CHECK-NEXT:            ld 12, 0(11)
+# CHECK-NEXT:            ld 11, 8(11)
+# CHECK-NEXT:            mtctr 12
+# CHECK-NEXT:            bctr
+# CHECK-NEXT:            <unknown>
+# CHECK-NEXT:            <unknown>
+## DT_PPC64_GLINK+0x20 = 0x10010300
+# CHECK-NEXT:  10010300: b 0x100102c4 <.glink>
+# CHECK-NOT:   {{.}}
 
         .text
         .abiversion 2


        


More information about the llvm-commits mailing list