This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: ld/1467: Orphaned section is put in the odd place
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Fri, 21 Oct 2005 14:16:47 -0700
- Subject: PATCH: ld/1467: Orphaned section is put in the odd place
I am checking in this patch to add a testcase.
H.J.
---
2005-10-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/1467
* ld-elf/orphan.d: New file.
* ld-elf/orphan.ld: Likewise.
* ld-elf/orphan.s: Likewise.
--- ld-elf/orphan.d.orphan 2005-10-21 14:03:11.000000000 -0700
+++ ld-elf/orphan.d 2005-10-21 14:06:55.000000000 -0700
@@ -0,0 +1,12 @@
+#source: orphan.s
+#ld: -T orphan.ld
+#readelf: -S --wide
+
+#...
+ \[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t0-9a-f]+AX.*
+ \[[ 0-9]+\] \.notbad[ \t]+PROGBITS[ \t0-9a-f]+A.*
+ \[[ 0-9]+\] \.data[ \t]+PROGBITS[ \t0-9a-f]+WA.*
+#...
+ \[[ 0-9]+\] \.note[ \t]+NOTE[ \t0-9a-f]+A.*
+ \[[ 0-9]+\] \.note.bar[ \t]+NOTE[ \t0-9a-f]+A.*
+#pass
--- ld-elf/orphan.ld.orphan 2005-10-21 14:03:14.000000000 -0700
+++ ld-elf/orphan.ld 2005-10-21 14:08:28.000000000 -0700
@@ -0,0 +1,7 @@
+SECTIONS
+{
+ .text : { *(.text) }
+ .data : { *(.data) }
+ .bss : { *(.bss) *(COMMON) }
+ .note : { *(.note) }
+}
--- ld-elf/orphan.s.orphan 2005-10-21 14:03:07.000000000 -0700
+++ ld-elf/orphan.s 2005-10-11 17:56:33.000000000 -0700
@@ -0,0 +1,10 @@
+ .text
+ .long 0
+ .data
+ .long 0
+ .section .note,"a","note"
+ .long 0
+ .section .notbad,"a","progbits"
+ .long 0
+ .section .note.bar,"a","note"
+ .long 0