RFC: Assign regions to orphan sections

Joseph S. Myers joseph@codesourcery.com
Thu May 6 19:51:00 GMT 2010

On Mon, 3 May 2010, Daniel Jacobowitz wrote:

> Does ld -N do the trick?  There may be some other oddities with
> objcopy, because BFD autodetects D_PAGED on input files with program
> headers based on the maxpagesize / minpagesize.

With -N, the test still fails, but because it has "RWE" where "R E" is 

regexp_diff match failure
regexp "^  LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x[0-9a-f]+$"
line   "  LOAD           0x000054 0x40000000 0x40000000 0x0000c 0x0000c RWE 0x4"
FAIL: ld-elf/orphan-region

But it also fails the same way with -N for i686-pc-linux-gnu so I assume 
this is simply an expected consequence of using -N.  With this patch 
applied to adjust the expectation as well as using -N, it passes for both 
c6x-elf and i686-pc-linux-gnu.  OK to commit?

2010-05-06  Joseph Myers  <joseph@codesourcery.com>

	* ld-elf/orphan-region.d: Use ld -N.

Index: ld/testsuite/ld-elf/orphan-region.d
RCS file: /cvs/src/src/ld/testsuite/ld-elf/orphan-region.d,v
retrieving revision 1.1
diff -u -r1.1 orphan-region.d
--- ld/testsuite/ld-elf/orphan-region.d	16 Mar 2010 14:14:40 -0000	1.1
+++ ld/testsuite/ld-elf/orphan-region.d	6 May 2010 19:50:16 -0000
@@ -1,5 +1,5 @@
 #source: orphan-region.s
-#ld: -T orphan-region.ld
+#ld: -T orphan-region.ld -N
 #readelf: -S -l --wide
@@ -9,7 +9,7 @@
 Program Headers:
-  LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x[0-9a-f]+
+  LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x[0-9a-f]+
  Section to Segment mapping:
   Segment Sections...

Joseph S. Myers

More information about the Binutils mailing list