summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-12-18 13:38:08 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-12-18 13:38:08 +0000
commit7b545d9cb6a8c5b812151e09c329745dafd56d64 (patch)
tree50e240fef8405231715422d8ee69ed13430c4da0
parent546299c5903732413d5f1f600dcc72e40820fb79 (diff)
downloadbinutils-redhat-7b545d9cb6a8c5b812151e09c329745dafd56d64.tar.gz
PR ld/14962
* ld-scripts/pr14962.d, * ld-scripts/pr14962.t, * ld-scripts/pr14962a.s, * ld-scripts/pr14962b.s: New test. * ld-scripts/expr.exp: Run it.
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-scripts/expr.exp1
-rw-r--r--ld/testsuite/ld-scripts/pr14962.d11
-rw-r--r--ld/testsuite/ld-scripts/pr14962.t8
-rw-r--r--ld/testsuite/ld-scripts/pr14962a.s10
-rw-r--r--ld/testsuite/ld-scripts/pr14962b.s4
6 files changed, 41 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index abbe043cb9..a97bd4214a 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2012-12-19 Alan Modra <amodra@gmail.com>
+
+ PR ld/14962
+ * ld-scripts/pr14962.d, * ld-scripts/pr14962.t,
+ * ld-scripts/pr14962a.s, * ld-scripts/pr14962b.s: New test.
+ * ld-scripts/expr.exp: Run it.
+
2012-12-17 Roland McGrath <mcgrathr@google.com>
* ld-elf/elf.exp (stack exec, stack size): Run for *-*-nacl* targets.
diff --git a/ld/testsuite/ld-scripts/expr.exp b/ld/testsuite/ld-scripts/expr.exp
index ea5002f9b3..0f92d979e4 100644
--- a/ld/testsuite/ld-scripts/expr.exp
+++ b/ld/testsuite/ld-scripts/expr.exp
@@ -24,3 +24,4 @@ run_dump_test expr1
run_dump_test expr2
run_dump_test sane1
run_dump_test assign-loc
+run_dump_test pr14962
diff --git a/ld/testsuite/ld-scripts/pr14962.d b/ld/testsuite/ld-scripts/pr14962.d
new file mode 100644
index 0000000000..616836d3a8
--- /dev/null
+++ b/ld/testsuite/ld-scripts/pr14962.d
@@ -0,0 +1,11 @@
+#ld: -Ttext=0x1000 -Tdata=0x2000 -T pr14962.t
+#source: pr14962a.s
+#source: pr14962b.s
+#nm: -n
+#notarget: rx-*-*
+# the reference to x would normally generate a cross-reference error
+# but the linker script converts x to absolute to avoid the error
+
+#...
+0+2000 A x
+#pass
diff --git a/ld/testsuite/ld-scripts/pr14962.t b/ld/testsuite/ld-scripts/pr14962.t
new file mode 100644
index 0000000000..f399acdcef
--- /dev/null
+++ b/ld/testsuite/ld-scripts/pr14962.t
@@ -0,0 +1,8 @@
+NOCROSSREFS ( .text .data )
+x = ABSOLUTE(x);
+SECTIONS
+{
+ .text : { *(.text) }
+ .data : { *(.data) }
+ /DISCARD/ : { *(*) }
+}
diff --git a/ld/testsuite/ld-scripts/pr14962a.s b/ld/testsuite/ld-scripts/pr14962a.s
new file mode 100644
index 0000000000..abaaaa691d
--- /dev/null
+++ b/ld/testsuite/ld-scripts/pr14962a.s
@@ -0,0 +1,10 @@
+ .globl main
+ .globl start
+ .globl _start
+ .globl __start
+ .text
+main:
+start:
+_start:
+__start:
+ .dc.a x
diff --git a/ld/testsuite/ld-scripts/pr14962b.s b/ld/testsuite/ld-scripts/pr14962b.s
new file mode 100644
index 0000000000..db27d7601e
--- /dev/null
+++ b/ld/testsuite/ld-scripts/pr14962b.s
@@ -0,0 +1,4 @@
+ .data
+ .globl x
+x:
+ .dc.a x