aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-powerpc/elfv2-2a.s27
-rw-r--r--ld/testsuite/ld-powerpc/elfv2-2b.s17
-rw-r--r--ld/testsuite/ld-powerpc/elfv2-2exe.d41
-rw-r--r--ld/testsuite/ld-powerpc/elfv2-2so.d5
-rw-r--r--ld/testsuite/ld-powerpc/powerpc.exp2
6 files changed, 98 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 701b088..b083aec 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2014-03-05 Alan Modra <amodra@gmail.com>
+
+ * ld-powerpc/elfv2-2a.s, ld-powerpc/elfv2-2b.s: New files.
+ * ld-powerpc/elfv2-2exe.d, ld-powerpc/elfv2-2so.d: New files.
+ * ld-powerpc/powerpc.exp: Run new test.
+
2014-03-03 Alan Modra <amodra@gmail.com>
* ld-scripts/phdrs2.exp: Correct copyright punctuation.
diff --git a/ld/testsuite/ld-powerpc/elfv2-2a.s b/ld/testsuite/ld-powerpc/elfv2-2a.s
new file mode 100644
index 0000000..303087a
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/elfv2-2a.s
@@ -0,0 +1,27 @@
+ .globl f1
+ .type f1,@function
+ .text
+f1:
+ addis 2,12,.TOC.-f1@ha
+ addi 2,2,.TOC.-f1@l
+ .localentry f1,.-f1
+ blr
+ .size f1,.-f1
+
+ .globl f2
+ .type f2,@function
+ .text
+f2:
+ addi 2,12,.TOC.-f2
+ .localentry f2,.-f2
+ blr
+ .size f2,.-f2
+
+ .quad f1
+ .quad f1@localentry
+ .quad f2
+ .quad f2@localentry
+ .quad f3
+ .quad f3@localentry
+ .quad f4
+ .quad f4@localentry
diff --git a/ld/testsuite/ld-powerpc/elfv2-2b.s b/ld/testsuite/ld-powerpc/elfv2-2b.s
new file mode 100644
index 0000000..9c9d75e
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/elfv2-2b.s
@@ -0,0 +1,17 @@
+ .globl f3
+ .type f3,@function
+ .text
+f3:
+ addis 2,12,.TOC.-f3@ha
+ addi 2,2,.TOC.-f3@l
+ .localentry f3,.-f3
+ blr
+ .size f3,.-f3
+
+ .globl f4
+ .type f4,@function
+ .text
+f4:
+ .localentry f4,0
+ blr
+ .size f4,.-f4
diff --git a/ld/testsuite/ld-powerpc/elfv2-2exe.d b/ld/testsuite/ld-powerpc/elfv2-2exe.d
new file mode 100644
index 0000000..c8deda1
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/elfv2-2exe.d
@@ -0,0 +1,41 @@
+#source: elfv2-2a.s
+#source: elfv2-2b.s
+#as: -a64
+#ld: -melf64ppc -e f1
+#objdump: -dr
+
+.*
+
+Disassembly of section \.text:
+
+0+10000078 <f1>:
+.*: (3c 40 10 01|01 10 40 3c) lis r2,4097
+.*: (38 42 80 78|78 80 42 38) addi r2,r2,-32648
+.*: (4e 80 00 20|20 00 80 4e) blr
+0+10000084 <f2>:
+.*: (38 4c 7f f4|f4 7f 4c 38) addi r2,r12,32756
+.*: (4e 80 00 20|20 00 80 4e) blr
+.*: (00 00 00 00|78 00 00 10) .*
+.*: (10 00 00 78|00 00 00 00) .*
+.*: (00 00 00 00|80 00 00 10) .*
+.*: (10 00 00 80|00 00 00 00) .*
+.*: (00 00 00 00|84 00 00 10) .*
+.*: (10 00 00 84|00 00 00 00) .*
+.*: (00 00 00 00|88 00 00 10) .*
+.*: (10 00 00 88|00 00 00 00) .*
+.*: (00 00 00 00|cc 00 00 10) .*
+.*: (10 00 00 cc|00 00 00 00) .*
+.*: (00 00 00 00|d4 00 00 10) .*
+.*: (10 00 00 d4|00 00 00 00) .*
+.*: (00 00 00 00|d8 00 00 10) .*
+.*: (10 00 00 d8|00 00 00 00) .*
+.*: (00 00 00 00|d8 00 00 10) .*
+.*: (10 00 00 d8|00 00 00 00) .*
+
+0+100000cc <f3>:
+.*: (3c 40 10 01|01 10 40 3c) lis r2,4097
+.*: (38 42 80 78|78 80 42 38) addi r2,r2,-32648
+.*: (4e 80 00 20|20 00 80 4e) blr
+
+0+100000d8 <f4>:
+.*: (4e 80 00 20|20 00 80 4e) blr
diff --git a/ld/testsuite/ld-powerpc/elfv2-2so.d b/ld/testsuite/ld-powerpc/elfv2-2so.d
new file mode 100644
index 0000000..56b1434
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/elfv2-2so.d
@@ -0,0 +1,5 @@
+#source: elfv2-2a.s
+#source: elfv2-2b.s
+#as: -a64
+#ld: -melf64ppc -shared -e f1
+#error: .* R_PPC64_ADDR64_LOCAL reloc unsupported in shared libraries and PIEs.*
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index 87e4ea8..2e8c126 100644
--- a/ld/testsuite/ld-powerpc/powerpc.exp
+++ b/ld/testsuite/ld-powerpc/powerpc.exp
@@ -271,6 +271,8 @@ if [ supports_ppc64 ] then {
run_dump_test "relbrlt"
run_dump_test "elfv2so"
run_dump_test "elfv2exe"
+ run_dump_test "elfv2-2so"
+ run_dump_test "elfv2-2exe"
}
if { [istarget "powerpc*-eabi*"] } {