aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-07-11 12:03:55 +0000
committerAlan Modra <amodra@gmail.com>2011-07-11 12:03:55 +0000
commit2843fdaab1bfef475382e13acfd6651bc4ae9e32 (patch)
tree1452da9ced8a1f64adb4a6c2cb6eeadb04018828 /ld
parent8c5eb9cdcf81e21cf40255e3f86f67f456431f63 (diff)
downloadgdb-2843fdaab1bfef475382e13acfd6651bc4ae9e32.zip
gdb-2843fdaab1bfef475382e13acfd6651bc4ae9e32.tar.gz
gdb-2843fdaab1bfef475382e13acfd6651bc4ae9e32.tar.bz2
* ld-powerpc/tocopt2.s, * ld-powerpc/tocopt2.out,
* ld-powerpc/tocopt2.d: New test. * ld-powerpc/tocopt3.s, * ld-powerpc/tocopt3.d: New test. * ld-powerpc/powerpc.exp (ppc64elftests) Run them.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-powerpc/powerpc.exp6
-rw-r--r--ld/testsuite/ld-powerpc/tocopt2.d5
-rw-r--r--ld/testsuite/ld-powerpc/tocopt2.out1
-rw-r--r--ld/testsuite/ld-powerpc/tocopt2.s10
-rw-r--r--ld/testsuite/ld-powerpc/tocopt3.d5
-rw-r--r--ld/testsuite/ld-powerpc/tocopt3.s9
7 files changed, 42 insertions, 1 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 1e74f6f..4fe8d0c 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-11 Alan Modra <amodra@gmail.com>
+
+ * ld-powerpc/tocopt2.s, * ld-powerpc/tocopt2.out,
+ * ld-powerpc/tocopt2.d: New test.
+ * ld-powerpc/tocopt3.s, * ld-powerpc/tocopt3.d: New test.
+ * ld-powerpc/powerpc.exp (ppc64elftests) Run them.
+
2011-07-03 Samuel Thibault <samuel.thibault@gnu.org>
Thomas Schwinge <thomas@schwinge.name>
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index ef0a6e1..bfffb42 100644
--- a/ld/testsuite/ld-powerpc/powerpc.exp
+++ b/ld/testsuite/ld-powerpc/powerpc.exp
@@ -204,7 +204,11 @@ set ppc64elftests {
{"sym@tocbase" "-shared -melf64ppc" "-a64" {symtocbase-1.s symtocbase-2.s}
{{objdump -dj.data symtocbase.d}} "symtocbase.so"}
{"TOC opt" "-melf64ppc" "-a64" {tocopt.s}
- {{objdump -s tocopt.d}} "tocopt"}
+ {{objdump -s tocopt.d}} "tocopt"}
+ {"TOC opt2" "-melf64ppc --defsym x=2" "-a64" {tocopt2.s}
+ {{ld tocopt2.out} {objdump -s tocopt2.d}} "tocopt2"}
+ {"TOC opt3" "-melf64ppc -no-keep-memory --defsym x=2" "-a64" {tocopt3.s}
+ {{objdump -s tocopt3.d}} "tocopt3"}
}
diff --git a/ld/testsuite/ld-powerpc/tocopt2.d b/ld/testsuite/ld-powerpc/tocopt2.d
new file mode 100644
index 0000000..174af27
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/tocopt2.d
@@ -0,0 +1,5 @@
+
+.*: file format .*
+
+Contents of section \.text:
+ 100000b0 3d22effe 39297f4a .*
diff --git a/ld/testsuite/ld-powerpc/tocopt2.out b/ld/testsuite/ld-powerpc/tocopt2.out
new file mode 100644
index 0000000..9f29071
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/tocopt2.out
@@ -0,0 +1 @@
+.*: xt defined on removed toc entry
diff --git a/ld/testsuite/ld-powerpc/tocopt2.s b/ld/testsuite/ld-powerpc/tocopt2.s
new file mode 100644
index 0000000..8d07de0
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/tocopt2.s
@@ -0,0 +1,10 @@
+ .globl xt
+ .section .toc,"aw"
+xt:
+ .quad x
+
+ .globl _start
+ .text
+_start:
+ addis 9,2,xt@toc@ha
+ ld 9,xt@toc@l(9)
diff --git a/ld/testsuite/ld-powerpc/tocopt3.d b/ld/testsuite/ld-powerpc/tocopt3.d
new file mode 100644
index 0000000..174af27
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/tocopt3.d
@@ -0,0 +1,5 @@
+
+.*: file format .*
+
+Contents of section \.text:
+ 100000b0 3d22effe 39297f4a .*
diff --git a/ld/testsuite/ld-powerpc/tocopt3.s b/ld/testsuite/ld-powerpc/tocopt3.s
new file mode 100644
index 0000000..abadbfa
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/tocopt3.s
@@ -0,0 +1,9 @@
+ .section .toc,"aw"
+0:
+ .quad x
+
+ .globl _start
+ .text
+_start:
+ addis 9,2,0b@toc@ha
+ ld 9,0b@toc@l(9)