summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2007-03-22 15:50:38 +0000
committerH.J. Lu <hjl@lucon.org>2007-03-22 15:50:38 +0000
commitc52abb21c958712db8d79ac1fa9ab8851a178583 (patch)
tree1ba140381b115b2bc34de930b0936d0dcb72cc13 /ld
parent98dab4ac68984e3efba6093495e28ffcca1e3bf9 (diff)
downloadbinutils-redhat-c52abb21c958712db8d79ac1fa9ab8851a178583.tar.gz
bfd/
2007-03-22 H.J. Lu <hongjiu.lu@intel.com> PR ld/4007 * elf.c (assign_file_positions_for_load_sections): Check if all sections are in the segment. ld/testsuite/ 2007-03-22 H.J. Lu <hongjiu.lu@intel.com> PR ld/4007 * ld-elf/note-1.d: New file. * ld-elf/note-1.s: Likewise. * ld-elf/note-1.t: Likewise. * ld-i386/alloc.d: Likewise. * ld-i386/alloc.s: Likewise. * ld-i386/alloc.t: Likewise. * ld-i386/i386.exp: Run "alloc".
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog12
-rw-r--r--ld/testsuite/ld-elf/note-1.d8
-rw-r--r--ld/testsuite/ld-elf/note-1.s6
-rw-r--r--ld/testsuite/ld-elf/note-1.t14
-rw-r--r--ld/testsuite/ld-i386/alloc.d4
-rw-r--r--ld/testsuite/ld-i386/alloc.s6
-rw-r--r--ld/testsuite/ld-i386/alloc.t13
-rw-r--r--ld/testsuite/ld-i386/i386.exp1
8 files changed, 64 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 20f932a434..07f28957b1 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2007-03-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/4007
+ * ld-elf/note-1.d: New file.
+ * ld-elf/note-1.s: Likewise.
+ * ld-elf/note-1.t: Likewise.
+ * ld-i386/alloc.d: Likewise.
+ * ld-i386/alloc.s: Likewise.
+ * ld-i386/alloc.t: Likewise.
+
+ * ld-i386/i386.exp: Run "alloc".
+
2007-03-20 Paul Brook <paul@codesourcery.com>
* ld-arm/arm-elf.exp (ld-arm/arm-elf.exp): Add arm-pic-veneer.
diff --git a/ld/testsuite/ld-elf/note-1.d b/ld/testsuite/ld-elf/note-1.d
new file mode 100644
index 0000000000..a5fc40f2e6
--- /dev/null
+++ b/ld/testsuite/ld-elf/note-1.d
@@ -0,0 +1,8 @@
+#ld: -Tnote-1.t
+#readelf: -l --wide
+
+#...
+ Section to Segment mapping:
+ Segment Sections...
+ 00 .foo
+ 01 .note
diff --git a/ld/testsuite/ld-elf/note-1.s b/ld/testsuite/ld-elf/note-1.s
new file mode 100644
index 0000000000..82c9513069
--- /dev/null
+++ b/ld/testsuite/ld-elf/note-1.s
@@ -0,0 +1,6 @@
+ .globl _entry
+ .section .foo,"awx",%progbits
+_entry:
+ .byte 0
+ .section .note,"",%note
+ .byte 0
diff --git a/ld/testsuite/ld-elf/note-1.t b/ld/testsuite/ld-elf/note-1.t
new file mode 100644
index 0000000000..031fe820ea
--- /dev/null
+++ b/ld/testsuite/ld-elf/note-1.t
@@ -0,0 +1,14 @@
+ENTRY(_entry)
+PHDRS
+{
+ data PT_LOAD;
+ note PT_NOTE;
+}
+SECTIONS
+{
+ . = 0x1000000;
+ .foo : { *(.foo) } :data
+ . = 0x2000000;
+ .note : { *(.note) } :note
+ /DISCARD/ : { *(*) }
+}
diff --git a/ld/testsuite/ld-i386/alloc.d b/ld/testsuite/ld-i386/alloc.d
new file mode 100644
index 0000000000..c2b22f2e00
--- /dev/null
+++ b/ld/testsuite/ld-i386/alloc.d
@@ -0,0 +1,4 @@
+#name: Invalid allocated section
+#as: --32
+#ld: -melf_i386 -T alloc.t
+#error: .*section `.foo' can't be allocated in segment 0.*
diff --git a/ld/testsuite/ld-i386/alloc.s b/ld/testsuite/ld-i386/alloc.s
new file mode 100644
index 0000000000..8c4f8fa196
--- /dev/null
+++ b/ld/testsuite/ld-i386/alloc.s
@@ -0,0 +1,6 @@
+ .section .bar,"ax","progbits"
+ .byte 0
+ .section .foo,"aw","progbits"
+ .byte 0
+ .bss
+ .long 0
diff --git a/ld/testsuite/ld-i386/alloc.t b/ld/testsuite/ld-i386/alloc.t
new file mode 100644
index 0000000000..ea7f48c5b0
--- /dev/null
+++ b/ld/testsuite/ld-i386/alloc.t
@@ -0,0 +1,13 @@
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+PHDRS {
+ text PT_LOAD FLAGS(5); /* R_E */
+}
+SECTIONS
+{
+ . = 0xC0000000 + ((0x100000 + (0x100000 - 1)) & ~(0x100000 - 1));
+ .bar : AT(ADDR(.bar) - 0xC0000000) { *(.bar) } :text
+ .bss : AT(ADDR(.bss) - 0xC0000000) { *(.bss) }
+ .foo 0 : AT(ADDR(.bss) + SIZEOF(.bss) - 0xC0000000) { *(.foo) } :text
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index d0d4cadaec..f008829382 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -114,3 +114,4 @@ run_dump_test "abs"
run_dump_test "pcrel8"
run_dump_test "pcrel16"
run_dump_test "pcrel16abs"
+run_dump_test "alloc"