From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9632 invoked by alias); 21 Apr 2010 14:44:53 -0000 Received: (qmail 9621 invoked by uid 22791); 21 Apr 2010 14:44:52 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,SARE_BAYES_5x8,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from portal.icerasemi.com (HELO pOrtaL.icerasemi.com) (213.249.204.90) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Apr 2010 14:44:12 +0000 X-ASG-Debug-ID: 1271861048-615500040000-Lwtx7q X-Barracuda-URL: http://192.168.1.243:80/cgi-bin/mark.cgi Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com (Spam & Virus Firewall) with ESMTP id ED44BF8C06; Wed, 21 Apr 2010 14:44:08 +0000 (GMT) Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com with ESMTP id gj72b8vIjVoIE2Wl; Wed, 21 Apr 2010 14:44:08 +0000 (GMT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-ASG-Orig-Subj: RE: VMA section overlap warnings for overlays Subject: RE: VMA section overlap warnings for overlays Date: Wed, 21 Apr 2010 14:44:00 -0000 Message-ID: <4D60B0700D1DB54A8C0C6E9BE69163700E7815C7@EXCHANGEVS.IceraSemi.local> References: <4D60B0700D1DB54A8C0C6E9BE69163700E67DFD1@EXCHANGEVS.IceraSemi.local> <20100421082441.GG3510@bubble.grove.modra.org> From: "David Stubbs" To: "Alan Modra" Cc: X-Barracuda-Connect: cluster1.icerasemi.local[192.168.1.203] X-Barracuda-Start-Time: 1271861048 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.27970 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00278.txt.bz2 > > Am I doing something wrong or unusual in my linker script, or > does it > > look like there's a problem in the linker? >=20 > Your script is fine. I'm looking at reverting Jan's patch. On a related note, I've noticed that a slightly 'enhanced' version of the linker script ends up with incorrect LMAs being used. Here's the script: --- UTPUT_FORMAT("elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) PHDRS { mem PT_LOAD; info PT_LOAD; imem PT_LOAD; } SECTIONS { .text 0x1000: { *(.text) } :mem .overlays 0x9000: { LONG (LOADADDR (.overlay1)) LONG (LOADADDR (.overlay2)) LONG (LOADADDR (.overlay3)) } :info .imem 0x2000 : AT (LOADADDR (.text) + SIZEOF (.text)) { *(.imem) } :imem .overlay1 ALIGN (ADDR (.imem) + SIZEOF (.imem), 8K)=20 : AT (LOADADDR (.imem) + SIZEOF (.imem)) { *(.overlay.1) } :imem =20=20=20=20=20=20=20 .overlay2 ALIGN (ADDR (.imem) + SIZEOF (.imem), 8K) : AT (LOADADDR (.overlay1) + SIZEOF (.overlay1)) { *(.overlay.2) } :imem .overlay3 ALIGN (ADDR (.imem) + SIZEOF (.imem), 8k) : AT (LOADADDR (.overlay2) + SIZEOF (.overlay2)) { *(.overlay.3) } :imem } --- The .overlays section reports the load addresses as: --- Hex dump of section '.overlays': 0x00009000 00001004 00001003 00001002 ............ --- Whereas the section headers report: --- Idx Name Size VMA LMA File off Algn 1 .overlay1 00000001 00004000 00003001 00005000 2**0 4 .overlay2 00000001 00004000 00003002 00005001 2**0 5 .overlay3 00000001 00004000 00003003 00005002 2**0 --- So the LMAs in the .overlays section do not match the LMAs in the section headers. And for completeness, the program headers looks like: --- Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x001000 0x00001000 0x00001000 0x00001 0x00001 R E 0x1000 LOAD 0x002000 0x00009000 0x00009000 0x0000c 0x0000c RW 0x1000 LOAD 0x003000 0x00002000 0x00001001 0x02003 0x02003 R E 0x1000 Section to Segment mapping: Segment Sections... 00 .text=20 01 .overlays=20 02 .overlay1 .imem .overlay2 .overlay3 --- I think it's the contents of the .overlays section that is actually incorrect in this case.=20 I don't think reverting that patch alone fixes it though. In fact, from a very quick test I get this error: --- /home/stubbs/local_disc/work/gnu_live_sources/binutils/build/ld/ld-new: test.exe: section `.overlay1' can't be allocated in segment 2 LOAD: .imem .overlay1 .overlay2 .overlay3 --- Which definitely doesn't look correct to me. There must be some other associated change that I've not yet found... I was planning on taking another look into this, but would obviously appreciate any help you can provide! Thanks again, Dave.