summaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-04-21 13:46:20 -0700
committerFangrui Song <i@maskray.me>2023-04-21 13:46:20 -0700
commit2a3fbb6bd86bf79c0b3c5b118b4c7128938018ed (patch)
tree6a598ea9412d7e88f9f390a61ce0671109e1e1fe /lld
parentf38d8be41aa9abc5ff39648e66d927b118c6c76d (diff)
downloadllvm-2a3fbb6bd86bf79c0b3c5b118b4c7128938018ed.tar.gz
[ELF][test] Test .glink code sequence and DT_PPC64_GLINK
Diffstat (limited to 'lld')
-rw-r--r--lld/test/ELF/ppc64-plt-stub.s20
1 files changed, 20 insertions, 0 deletions
diff --git a/lld/test/ELF/ppc64-plt-stub.s b/lld/test/ELF/ppc64-plt-stub.s
index 2f9f4cb5a51d..76d12d442a16 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