]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR ld/14962
authorAlan Modra <amodra@gmail.com>
Tue, 18 Dec 2012 13:38:10 +0000 (13:38 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 18 Dec 2012 13:38:10 +0000 (13:38 +0000)
* ld-scripts/pr14962.d, * ld-scripts/pr14962.t,
* ld-scripts/pr14962a.s, * ld-scripts/pr14962b.s: New test.
* ld-scripts/expr.exp: Run it.

ld/testsuite/ChangeLog
ld/testsuite/ld-scripts/expr.exp
ld/testsuite/ld-scripts/pr14962.d [new file with mode: 0644]
ld/testsuite/ld-scripts/pr14962.t [new file with mode: 0644]
ld/testsuite/ld-scripts/pr14962a.s [new file with mode: 0644]
ld/testsuite/ld-scripts/pr14962b.s [new file with mode: 0644]

index abbe043cb93a18ef87ed0bfaab17d48866e6f064..a97bd4214a8f5c5236d442817cb7c2bb8cc660fa 100644 (file)
@@ -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.
index ea5002f9b35853e2c7ae3c779c7daa1336fee93a..0f92d979e43c4ae29e4ea5bf3114d8a0284993b1 100644 (file)
@@ -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 (file)
index 0000000..616836d
--- /dev/null
@@ -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 (file)
index 0000000..f399acd
--- /dev/null
@@ -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 (file)
index 0000000..abaaaa6
--- /dev/null
@@ -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 (file)
index 0000000..db27d76
--- /dev/null
@@ -0,0 +1,4 @@
+       .data
+       .globl x
+x:
+       .dc.a x