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: [PATCH] Re: Linker script values as absolute / relative / number confusion


On Fri, Sep 14, 2012 at 11:53:09PM +0100, Andrew Burgess wrote:
> 2012-09-14  Andrew Burgess  <aburgess@broadcom.com>
> 
> 	* ld-scripts/assign-loc.d: New file.  Test for assigning absolute
> 	symbol to location counter.
> 	* ld-scripts/assign-loc.t: New file.  Linker script for above
> 	test.
> 	* ld-scripts/expr.exp: Add new assignment test.

Tests like this one need a little more work to ensure they pass on
targets other than i686-linux.  Applied as follows.

Index: ld/testsuite/ld-scripts/assign-loc.d
===================================================================
RCS file: ld/testsuite/ld-scripts/assign-loc.d
diff -N ld/testsuite/ld-scripts/assign-loc.d
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-scripts/assign-loc.d	19 Sep 2012 02:46:53 -0000
@@ -0,0 +1,11 @@
+#ld: -T assign-loc.t
+#source: data.s
+#nm: -n
+#notarget: rs6000-*-aix*
+#...
+0+0100 A HEAP_SIZE
+#...
+0+2000 [AB] _start
+#...
+0+2100 [AB] _end
+#pass
Index: ld/testsuite/ld-scripts/assign-loc.t
===================================================================
RCS file: ld/testsuite/ld-scripts/assign-loc.t
diff -N ld/testsuite/ld-scripts/assign-loc.t
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-scripts/assign-loc.t	19 Sep 2012 02:46:53 -0000
@@ -0,0 +1,17 @@
+SECTIONS
+{
+  . = 0x2000 ;
+
+  _start = .;
+
+  HEAP_SIZE = 0x100;
+
+  .heap : {
+    . = HEAP_SIZE;
+    . = ALIGN(4);
+  }
+
+  _end = .;
+
+  /DISCARD/ : { *(*) }
+}
Index: ld/testsuite/ld-scripts/expr.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-scripts/expr.exp,v
retrieving revision 1.4
diff -u -p -r1.4 expr.exp
--- ld/testsuite/ld-scripts/expr.exp	23 Jan 2011 03:29:29 -0000	1.4
+++ ld/testsuite/ld-scripts/expr.exp	19 Sep 2012 02:46:53 -0000
@@ -23,3 +23,4 @@
 run_dump_test expr1
 run_dump_test expr2
 run_dump_test sane1
+run_dump_test assign-loc

-- 
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]