PowerPC local got test
authorAlan Modra <amodra@gmail.com>
Tue, 8 Oct 2019 00:30:11 +0000 (11:00 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 8 Oct 2019 13:50:19 +0000 (00:20 +1030)
This is the one that causes ld segfaults between 2019-10-04 and
2019-10-07.  Bug introduced with f749f26eea, fixed by 93370e8e7b.

* testsuite/ld-powerpc/localgot.s,
* testsuite/ld-powerpc/localgot.d: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.

ld/ChangeLog
ld/testsuite/ld-powerpc/localgot.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/localgot.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/powerpc.exp

index a54576540880a82e6b27f212fe87f29572c77e34..c20425b5356eee9374a7eee611ec805e1f2d8f23 100644 (file)
@@ -1,3 +1,9 @@
+2019-10-08  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/ld-powerpc/localgot.s,
+       * testsuite/ld-powerpc/localgot.d: New test.
+       * testsuite/ld-powerpc/powerpc.exp: Run it.
+
 2019-10-07  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
 
        * testsuite/ld-msp430-elf/attr-gnu-main.s: New test.
diff --git a/ld/testsuite/ld-powerpc/localgot.d b/ld/testsuite/ld-powerpc/localgot.d
new file mode 100644 (file)
index 0000000..f58a979
--- /dev/null
@@ -0,0 +1,8 @@
+#source: localgot.s
+#as: -mppc64
+#ld: -pie
+#readelf: -r
+
+Relocation section '\.rela\.dyn' at offset .* contains 1 entry:
+ +Offset +Info +Type.*
+.*_RELATIVE .*
diff --git a/ld/testsuite/ld-powerpc/localgot.s b/ld/testsuite/ld-powerpc/localgot.s
new file mode 100644 (file)
index 0000000..600be56
--- /dev/null
@@ -0,0 +1,5 @@
+ .text
+ .global _start
+_start:
+x:
+ ld 3,x@got(2) # isn't correct for 32-bit, but hey this is just a testcase
index bbd4813ebd12032dc27f5d600224246c24ff8bf4..7634891a60bb83884428c4e70396f8b928588c0c 100644 (file)
@@ -374,6 +374,7 @@ if [ supports_ppc64 ] then {
     run_dump_test "tlsie"
 }
 
+run_dump_test "localgot"
 run_dump_test "tlsldopt32"
 
 run_ld_link_tests $ppceabitests