summaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2013-09-04 12:28:11 +0000
committerTristan Gingold <gingold@adacore.com>2013-09-04 12:28:11 +0000
commitd52cab117861173b30de6f268894d41a9c471503 (patch)
treee6401e8d2a06ad72f7032e1a35a653eabbca77a3 /gas/testsuite
parented78d2205b4e92789bc140fb50195547a2302f30 (diff)
downloadbinutils-redhat-d52cab117861173b30de6f268894d41a9c471503.tar.gz
gas/
* config/tc-ppc.c (md_apply_fix): Handle defined after use toc symbols. gas/testsuite/ * gas/ppc/aix.exp: Run xcoff-toc-1 test. * gas/ppc/xcoff-toc-1.s, gas/ppc/xcoff-toc-1.d: New test.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/ppc/aix.exp1
-rw-r--r--gas/testsuite/gas/ppc/xcoff-toc-1.d12
-rw-r--r--gas/testsuite/gas/ppc/xcoff-toc-1.s21
4 files changed, 39 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 15e00f3e74..2110cd94de 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-04 Tristan Gingold <gingold@adacore.com>
+
+ * gas/ppc/aix.exp: Run xcoff-toc-1 test.
+ * gas/ppc/xcoff-toc-1.s, gas/ppc/xcoff-toc-1.d: New test.
+
2013-09-04 Roland McGrath <mcgrathr@google.com>
PR gas/15914
diff --git a/gas/testsuite/gas/ppc/aix.exp b/gas/testsuite/gas/ppc/aix.exp
index 27898376c3..9612f27d19 100644
--- a/gas/testsuite/gas/ppc/aix.exp
+++ b/gas/testsuite/gas/ppc/aix.exp
@@ -67,6 +67,7 @@ if [istarget powerpc-ibm-aix*] then {
run_dump_test "xcoff-branch-1-64"
run_dump_test "xcoff-br16-1"
run_dump_test "xcoff-br16-2"
+ run_dump_test "xcoff-toc-1"
run_list_test "xcoff-ref-1"
diff --git a/gas/testsuite/gas/ppc/xcoff-toc-1.d b/gas/testsuite/gas/ppc/xcoff-toc-1.d
new file mode 100644
index 0000000000..bb856944f6
--- /dev/null
+++ b/gas/testsuite/gas/ppc/xcoff-toc-1.d
@@ -0,0 +1,12 @@
+#as: -a32
+#source: xcoff-toc-1.s
+#objdump: -dr
+#name: XCOFF TOC reloc test 1
+
+.*
+Disassembly of section \.text:
+
+00000000 <\.foo>:
+ 0: 80 22 00 00 l r1,0\(r2\)
+ 2: R_TOC data-0x10010
+ 4: 4e 80 00 20 br
diff --git a/gas/testsuite/gas/ppc/xcoff-toc-1.s b/gas/testsuite/gas/ppc/xcoff-toc-1.s
new file mode 100644
index 0000000000..ac491aef6d
--- /dev/null
+++ b/gas/testsuite/gas/ppc/xcoff-toc-1.s
@@ -0,0 +1,21 @@
+ .csect _rw_[RW],4
+ .toc
+
+ .csect .text[PR]
+ .align 2
+ .lglobl .foo
+ .csect foo[DS]
+foo:
+ .long .foo, TOC[tc0], 0
+ .csect .text[PR]
+.foo:
+ lwz 1,LC..72(2)
+ blr
+ .align 2
+ .toc
+LC..72:
+ .tc data[TC],data
+ .csect _rw_[RW],4
+ .align 2
+data:
+ .space 0x10000