From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29879 invoked by alias); 12 May 2010 13:19:39 -0000 Received: (qmail 29866 invoked by uid 22791); 12 May 2010 13:19:38 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,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, 12 May 2010 13:19:29 +0000 X-ASG-Debug-ID: 1273670365-1b8b00010000-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 DC51F58074; Wed, 12 May 2010 13:19:25 +0000 (GMT) Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com with ESMTP id ilozDtHQ4GZ36lay; Wed, 12 May 2010 13:19:25 +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, 12 May 2010 13:19:00 -0000 Message-ID: <4D60B0700D1DB54A8C0C6E9BE69163700ED69E1A@EXCHANGEVS.IceraSemi.local> References: <4D60B0700D1DB54A8C0C6E9BE69163700E67DFD1@EXCHANGEVS.IceraSemi.local> <20100421082441.GG3510@bubble.grove.modra.org> <4D60B0700D1DB54A8C0C6E9BE69163700E7815C7@EXCHANGEVS.IceraSemi.local> <20100422011106.GI3510@bubble.grove.modra.org> <20100422015303.GK3510@bubble.grove.modra.org> <4D60B0700D1DB54A8C0C6E9BE69163700E7F2F15@EXCHANGEVS.IceraSemi.local> <20100424021750.GQ3510@bubble.grove.modra.org> <4D60B0700D1DB54A8C0C6E9BE69163700EC60376@EXCHANGEVS.IceraSemi.local> <20100508114913.GA31122@bubble.grove.modra.org> From: "David Stubbs" To: "Alan Modra" Cc: , "sdkteam-gnu" X-Barracuda-Connect: cluster1.icerasemi.local[192.168.1.203] X-Barracuda-Start-Time: 1273670365 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.29650 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-05/txt/msg00108.txt.bz2 > On Fri, May 07, 2010 at 05:14:06PM +0100, David Stubbs wrote: > > Does the following patch look like the correct fix? >=20 > No, it doesn't look correct. I think your problem is more likely > due > to a ldlang.c bug in setting lma. Do you have a testcase handy? Thanks for the response. I didn't realize / think that you needed to allocate filespace for bss sections when they're followed by non BSS sections in the same segment.=20 I wasn't able to reproduce the problem, but that turned out to be because I'd somehow lost the bit of code that calls write_zeros in our copy of the source. I have however found another potential problem with strip. Here's the test: --- brsbs01 0>cat start.s .section .text,"ax",@progbits .globl _start .type _start, @function _start: nop =20=20=20=20=20=20=20 .section .dmem.bss,"aw",@nobits .zero 0x10 brsbs01 0>cat over.S .section SEC_NAME,"ax",@progbits .zero 0x10 .section SEC_NAME.bss,"aw",@nobits .zero 0x10 brsbs01 0>cat ldscript.x OUTPUT_FORMAT("elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) PHDRS { mem PT_LOAD; imem PT_LOAD; } SECTIONS { .text 0x1000: { *(.text) } :mem .dmem.bss 0x2000 : AT (LOADADDR (.text) + SIZEOF (.text)) { *(.dmem.bss) } :imem .overlay1 ADDR (.dmem.bss) + SIZEOF (.dmem.bss) : AT (LOADADDR (.dmem.bss) + SIZEOF (.dmem.bss)) { *(.overlay1) } :imem =20=20=20=20=20=20 .overlay2 ADDR (.dmem.bss) + SIZEOF (.dmem.bss) : AT (LOADADDR (.overlay1) + SIZEOF (.overlay1)) { *(.overlay2) } :imem .overlay1.bss ADDR (.overlay1) + SIZEOF (.overlay1) : AT (LOADADDR (.overlay2) + SIZEOF (.overlay2)) { *(.overlay1.bss) } :imem .overlay2.bss ADDR (.overlay2) + SIZEOF (.overlay2) : AT (LOADADDR (.overlay1.bss) + SIZEOF (.overlay1.bss)) { *(.overlay1.bss) } :imem } brsbs01 0>gcc over.S -DSEC_NAME=3D.overlay1 -c -o over1.o brsbs01 0>gcc over.S -DSEC_NAME=3D.overlay2 -c -o over2.o brsbs01 0>gcc start.s -c -o start.o brsbs01 0>ld over1.o over2.o start.o -T ldscript.x -o test.exe=20 brsbs01 1>strip test.exe BFD: stHVOxcK: section .overlay1.bss lma 0x1021 overlaps previous sections BFD: stHVOxcK: section .overlay2.bss lma 0x1021 overlaps previous sections --- The overlap warning is being emitted because 'adjust' is being calculated as a negative number. I don't yet know why. Thanks again, Dave.