This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: New INSERT linker script command
On Fri, Jan 25, 2008 at 06:43:12AM -0800, H.J. Lu wrote:
> Can you add some testcases which will run for Linux/x86 target so
> that it will be tested by more people?
OK, I'll modify an existing test.
* ld-elf/loadaddr.t: New, extracted from..
* ld-elf/loadaddr1.t: ..here. Use insert.
* ld-elf/loadaddr2.t: Likewise.
* ld-elf/loadaddr1.d: Update.
* ld-elf/loadaddr2.d: Update.
Index: ld/testsuite/ld-elf/loadaddr.t
===================================================================
RCS file: ld/testsuite/ld-elf/loadaddr.t
diff -N ld/testsuite/ld-elf/loadaddr.t
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-elf/loadaddr.t 26 Jan 2008 02:19:54 -0000
@@ -0,0 +1,10 @@
+SECTIONS
+{
+ . = -0x7ff00000;
+ .text : {*(.text .text.*)}
+ . = ALIGN(64);
+ .foo : { *(.foo) }
+ . = ALIGN(8192);
+ .data : AT (ADDR(.data)) { *(.data) }
+ /DISCARD/ : { *(.*) }
+}
Index: ld/testsuite/ld-elf/loadaddr1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/loadaddr1.d,v
retrieving revision 1.2
diff -u -p -r1.2 loadaddr1.d
--- ld/testsuite/ld-elf/loadaddr1.d 15 Sep 2006 14:48:46 -0000 1.2
+++ ld/testsuite/ld-elf/loadaddr1.d 26 Jan 2008 02:15:24 -0000
@@ -1,5 +1,5 @@
#source: loadaddr.s
-#ld: -T loadaddr1.t -z max-page-size=0x200000
+#ld: -T loadaddr1.t -T loadaddr.t -z max-page-size=0x200000
#readelf: -l --wide
#target: *-*-linux*
Index: ld/testsuite/ld-elf/loadaddr1.t
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/loadaddr1.t,v
retrieving revision 1.2
diff -u -p -r1.2 loadaddr1.t
--- ld/testsuite/ld-elf/loadaddr1.t 23 Aug 2006 14:45:30 -0000 1.2
+++ ld/testsuite/ld-elf/loadaddr1.t 26 Jan 2008 02:15:24 -0000
@@ -1,13 +1,7 @@
SECTIONS
{
- . = -0x7ff00000;
- .text : {*(.text .text.*)}
- . = ALIGN(64);
- .foo : { *(.foo) }
.bar -0xa00000 : AT ((LOADADDR(.foo) + SIZEOF(.foo) + 4095) & ~(4095))
{ *(.bar) }
. = LOADADDR(.bar) + 4096;
- . = ALIGN(8192);
- .data : AT (ADDR(.data)) { *(.data) }
- /DISCARD/ : { *(.*) }
}
+INSERT AFTER .foo;
Index: ld/testsuite/ld-elf/loadaddr2.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/loadaddr2.d,v
retrieving revision 1.2
diff -u -p -r1.2 loadaddr2.d
--- ld/testsuite/ld-elf/loadaddr2.d 15 Sep 2006 14:48:46 -0000 1.2
+++ ld/testsuite/ld-elf/loadaddr2.d 26 Jan 2008 02:15:24 -0000
@@ -1,5 +1,5 @@
#source: loadaddr.s
-#ld: -T loadaddr2.t -z max-page-size=0x200000
+#ld: -T loadaddr2.t -T loadaddr.t -z max-page-size=0x200000
#readelf: -l --wide
#target: *-*-linux*
Index: ld/testsuite/ld-elf/loadaddr2.t
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/loadaddr2.t,v
retrieving revision 1.2
diff -u -p -r1.2 loadaddr2.t
--- ld/testsuite/ld-elf/loadaddr2.t 23 Aug 2006 14:45:30 -0000 1.2
+++ ld/testsuite/ld-elf/loadaddr2.t 26 Jan 2008 02:15:24 -0000
@@ -1,13 +1,7 @@
SECTIONS
{
- . = -0x7ff00000;
- .text : {*(.text .text.*)}
- . = ALIGN(64);
- .foo : { *(.foo) }
.bar -0x7fef0000 : AT ((LOADADDR(.foo) + SIZEOF(.foo) + 4095) & ~(4095))
{ *(.bar) }
. = LOADADDR(.bar) + 0x200000;
- . = ALIGN(8192);
- .data : AT (ADDR(.data)) { *(.data) }
- /DISCARD/ : { *(.*) }
}
+INSERT BEFORE .data;
--
Alan Modra
Australia Development Lab, IBM