This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR ld/11998: Bogus linker warning


On Fri, Sep 10, 2010 at 03:00:45AM +0200, Hans-Peter Nilsson wrote:
> > Date: Thu, 9 Sep 2010 12:19:50 -0700
> > From: "H.J. Lu" <hongjiu.lu@intel.com>
> 
> > This patch removes bugos linker warning on zero LMA adjustment.  I
> > verified that linker generates the same output as binutils 2.20.

An odd testcase, with a wrap in the first segment caused by stuffing
in the ELF file header and program headers..

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0xfffff12c 0x01002 0x01002 R   0x1000
  LOAD           0x002000 0x00002000 0x00002000 0x00004 0x00004 R   0x1000
  LOAD           0x003000 0x00005000 0x0000412c 0x00002 0x00002 R   0x1000
  LOAD           0x004000 0x00004000 0x0000603c 0x00002 0x00002 R   0x1000

I guess the patch is OK, but the testsuite addition shouldn't be seen
as officially blessing current linker behaviour.  I think it would be
less surprising if we kept the headers out of the .sec0 LOAD header
in cases like this, not that I intend to change anything right now.

> > I
> > am checking it in as an obvious fix.
> 
> Me too!  Same restriction as on other -z max-page-size=... usage:
> 
> ld/testsuite:
> 	* ld-scripts/rgn-at5.d: Restrict to *-*-linux*.

When I saw this I wondered if I had to add "#notarget: *-*-*aout", to
stop the test being run for linuxaout, but you're OK.  We already use
is_elf_format in the .exp file.  :)

Committed.

	* ld-gc/abi-note.d: Exclude aout and oldld targets.
	* ld-gc/start.d: Likewise.
	* ld-scripts/section-match-1.d: Likewise, and tic30.

Index: ld/testsuite/ld-gc/abi-note.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-gc/abi-note.d,v
retrieving revision 1.1
diff -u -p -r1.1 abi-note.d
--- ld/testsuite/ld-gc/abi-note.d	7 Jan 2010 13:44:37 -0000	1.1
+++ ld/testsuite/ld-gc/abi-note.d	10 Sep 2010 07:03:04 -0000
@@ -2,6 +2,7 @@
 #ld: --gc-sections -e _start
 #readelf: -S --wide
 #target: *-*-linux*
+#notarget: *-*-*aout *-*-*oldld
 
 #...
 .* .note.ABI-tag[ 	]+NOTE.*
Index: ld/testsuite/ld-gc/start.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-gc/start.d,v
retrieving revision 1.1
diff -u -p -r1.1 start.d
--- ld/testsuite/ld-gc/start.d	8 Jan 2010 01:43:23 -0000	1.1
+++ ld/testsuite/ld-gc/start.d	10 Sep 2010 07:03:04 -0000
@@ -2,6 +2,7 @@
 #ld: --gc-sections -e _start
 #nm: -n
 #target: *-*-linux*
+#notarget: *-*-*aout *-*-*oldld
 
 #...
 [0-9a-f]+ A +__start__foo
Index: ld/testsuite/ld-scripts/section-match-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-scripts/section-match-1.d,v
retrieving revision 1.1
diff -u -p -r1.1 section-match-1.d
--- ld/testsuite/ld-scripts/section-match-1.d	1 Sep 2010 08:05:16 -0000	1.1
+++ ld/testsuite/ld-scripts/section-match-1.d	10 Sep 2010 07:03:05 -0000
@@ -1,7 +1,7 @@
 #source: section-match-1.s
 #ld: -T section-match-1.t
 #objdump: -s
-#notarget: *-*-osf* *-*-aix* *-*-pe *-*-aout *-*-ecoff *-*-netbsd *-*-vms h8300-*-*
+#notarget: *-*-osf* *-*-aix* *-*-pe *-*-*aout *-*-*oldld *-*-ecoff *-*-netbsd *-*-vms h8300-*-* tic30-*-*
 # This test uses arbitary section names, which are not support by some
 # file formts.  Also these section names must be present in the
 # output, not translated into some other name, eg .text



-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]