aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-03-16 14:14:40 +0000
committerDaniel Jacobowitz <drow@false.org>2010-03-16 14:14:40 +0000
commitf77c3948254d0653c6957562cba846107dcb6d89 (patch)
tree1dfb5859f3769445a4327ce4df66df120775026e /ld/testsuite
parent99164030b983b819ff55debcd0c7d9e2d91e84ee (diff)
downloadgdb-f77c3948254d0653c6957562cba846107dcb6d89.zip
gdb-f77c3948254d0653c6957562cba846107dcb6d89.tar.gz
gdb-f77c3948254d0653c6957562cba846107dcb6d89.tar.bz2
* ldlang.c (lang_insert_orphan): Place loadable orphans in the same
region and phdrs as their placement section. testsuite/ * ld-elf/orphan-region.d, ld-elf/orphan-region.ld, ld-elf/orphan-region.s: New files.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-elf/orphan-region.d16
-rw-r--r--ld/testsuite/ld-elf/orphan-region.ld10
-rw-r--r--ld/testsuite/ld-elf/orphan-region.s8
4 files changed, 39 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 3ceacd4..6db73e8 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-15 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * ld-elf/orphan-region.d, ld-elf/orphan-region.ld,
+ ld-elf/orphan-region.s: New files.
+
2010-03-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
* ld-arm/arm-merge-incompatible.d: New test.
diff --git a/ld/testsuite/ld-elf/orphan-region.d b/ld/testsuite/ld-elf/orphan-region.d
new file mode 100644
index 0000000..eb3d2cf
--- /dev/null
+++ b/ld/testsuite/ld-elf/orphan-region.d
@@ -0,0 +1,16 @@
+#source: orphan-region.s
+#ld: -T orphan-region.ld
+#readelf: -S -l --wide
+
+#...
+ \[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.*
+ \[[ 0-9]+\] \.rodata[ \t]+PROGBITS[ \t]+0*400000[0-9a-f]+[ \t]+.*
+ \[[ 0-9]+\] \.moredata[ \t]+PROGBITS[ \t]+0*400000[0-9a-f]+[ \t]+.*
+#...
+Program Headers:
+ Type.*
+ LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x[0-9a-f]+
+
+ Section to Segment mapping:
+ Segment Sections...
+ 00 .text .rodata .moredata *
diff --git a/ld/testsuite/ld-elf/orphan-region.ld b/ld/testsuite/ld-elf/orphan-region.ld
new file mode 100644
index 0000000..e20cbaf
--- /dev/null
+++ b/ld/testsuite/ld-elf/orphan-region.ld
@@ -0,0 +1,10 @@
+MEMORY
+{
+ region : ORIGIN = 0x40000000, LENGTH = 8M
+}
+
+SECTIONS
+{
+ .text : ALIGN (4) { *(.text) } > region
+ .rodata : ALIGN (4) { *(.rodata) } > region
+} \ No newline at end of file
diff --git a/ld/testsuite/ld-elf/orphan-region.s b/ld/testsuite/ld-elf/orphan-region.s
new file mode 100644
index 0000000..0268686
--- /dev/null
+++ b/ld/testsuite/ld-elf/orphan-region.s
@@ -0,0 +1,8 @@
+ .text
+ .long 0
+ .section ".rodata", "a", %progbits
+ .long 0
+ .section ".moredata", "a", %progbits
+ .long 0
+ .section ".notdata", "", %progbits
+ .long 0