This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR14962 fix


This is the testcase I was using.  Since it isn't ELF specific, and it
shows up other real bugs, I'm committing this even though HJ already
committed a testcase for the PR.

	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.

Index: ld/testsuite/ld-scripts/expr.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-scripts/expr.exp,v
retrieving revision 1.5
diff -u -p -r1.5 expr.exp
--- ld/testsuite/ld-scripts/expr.exp	19 Sep 2012 02:51:09 -0000	1.5
+++ ld/testsuite/ld-scripts/expr.exp	18 Dec 2012 13:27:59 -0000
@@ -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
Index: ld/testsuite/ld-scripts/pr14962.d
===================================================================
RCS file: ld/testsuite/ld-scripts/pr14962.d
diff -N ld/testsuite/ld-scripts/pr14962.d
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-scripts/pr14962.d	18 Dec 2012 13:27:59 -0000
@@ -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
Index: ld/testsuite/ld-scripts/pr14962.t
===================================================================
RCS file: ld/testsuite/ld-scripts/pr14962.t
diff -N ld/testsuite/ld-scripts/pr14962.t
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-scripts/pr14962.t	18 Dec 2012 13:27:59 -0000
@@ -0,0 +1,8 @@
+NOCROSSREFS ( .text .data )
+x = ABSOLUTE(x);
+SECTIONS
+{ 
+  .text : { *(.text) }
+  .data : { *(.data) }
+  /DISCARD/ : { *(*) }
+}
Index: ld/testsuite/ld-scripts/pr14962a.s
===================================================================
RCS file: ld/testsuite/ld-scripts/pr14962a.s
diff -N ld/testsuite/ld-scripts/pr14962a.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-scripts/pr14962a.s	18 Dec 2012 13:27:59 -0000
@@ -0,0 +1,10 @@
+	.globl main
+	.globl start
+	.globl _start
+	.globl __start
+	.text
+main:
+start:
+_start:
+__start:
+	.dc.a x
Index: ld/testsuite/ld-scripts/pr14962b.s
===================================================================
RCS file: ld/testsuite/ld-scripts/pr14962b.s
diff -N ld/testsuite/ld-scripts/pr14962b.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-scripts/pr14962b.s	18 Dec 2012 13:27:59 -0000
@@ -0,0 +1,4 @@
+	.data
+	.globl x
+x:
+	.dc.a x

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]