From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21200 invoked by alias); 7 May 2010 16:14:10 -0000 Received: (qmail 21188 invoked by uid 22791); 7 May 2010 16:14:09 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_50,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; Fri, 07 May 2010 16:14:04 +0000 X-ASG-Debug-ID: 1273248840-491b00000000-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 2811B42367; Fri, 7 May 2010 16:14:00 +0000 (GMT) Received: from Exchangevs.Icerasemi.com (cluster1.icerasemi.local [192.168.1.203]) by pOrtaL.icerasemi.com with ESMTP id Mn34j2PIbHgiSe6E; Fri, 07 May 2010 16:14:00 +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: Fri, 07 May 2010 16:14:00 -0000 Message-ID: <4D60B0700D1DB54A8C0C6E9BE69163700EC60376@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> From: "David Stubbs" To: Cc: "Alan Modra" , "sdkteam-gnu" X-Barracuda-Connect: cluster1.icerasemi.local[192.168.1.203] X-Barracuda-Start-Time: 1273248841 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.29238 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/msg00051.txt.bz2 Hi, If we have a single segment containing a BSS section followed by overlays then we still get the overlap warning.=20 Does the following patch look like the correct fix? I believe it fixes my original test case, and I've also tested it on i686-pc-linux-gnu without any problems. Thanks, Dave. Bfd/ChangeLog: 2010-05-07 David Stubbs * elf.c (assign_file_positions_for_load_sections): Calculate adjust based on file size instead of memory size. Increment p->p_memsz by=20 vma based calculation instead of adjust. Index: bfd/elf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/bfd/elf.c,v retrieving revision 1.510 diff -u -p -r1.510 elf.c --- bfd/elf.c 24 Apr 2010 01:05:24 -0000 1.510 +++ bfd/elf.c 7 May 2010 15:41:09 -0000 @@ -4453,17 +4453,17 @@ assign_file_positions_for_load_sections=20 && ((this_hdr->sh_flags & SHF_TLS) =3D=3D 0 || p->p_type =3D=3D PT_TLS)))) { - bfd_vma adjust =3D sec->lma - (p->p_paddr + p->p_memsz); + bfd_vma adjust =3D sec->lma - (p->p_paddr + p->p_filesz); =20 - if (sec->lma < p->p_paddr + p->p_memsz) + if (sec->lma < p->p_paddr + p->p_filesz) { (*_bfd_error_handler) (_("%B: section %A lma 0x%lx overlaps previous sections"), abfd, sec, (unsigned long) sec->lma); adjust =3D 0; - sec->lma =3D p->p_paddr + p->p_memsz; + sec->lma =3D p->p_paddr + p->p_filesz; } - p->p_memsz +=3D adjust; + p->p_memsz +=3D sec->vma - (p->p_vaddr + p->p_memsz); =20 if (this_hdr->sh_type !=3D SHT_NOBITS) {