From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24017 invoked by alias); 17 Apr 2007 11:13:01 -0000 Received: (qmail 24002 invoked by uid 22791); 17 Apr 2007 11:12:59 -0000 X-Spam-Check-By: sourceware.org Received: from sohm.kpit.com (HELO sohm.kpit.com) (203.197.93.231) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Apr 2007 12:12:56 +0100 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: No error for Linker Section Overlapping Date: Tue, 17 Apr 2007 13:17:00 -0000 Message-ID: In-Reply-To: <20070414012736.GP28088@bubble.grove.modra.org> From: "Deepen Mantri" To: "Alan Modra" Cc: 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: 2007-04/txt/msg00223.txt.bz2 Hi, Thank you for the reply.=09 >> The changes to lma assignment made using overlays considerably=20=09 >> simpler. In particular, sections following an overlay area now=09 >> don't need their LMAs set.=09 Yes, this is correct. However, it now seems to me that keyword=20=09 "OVERLAY" has become redundant. Even if you do not use or intend=20=09 to use it, the sections having overlapped VMAs are going to be=20=09 considered as overlay sections.=09 =09 Let's consider this case,=09 =09 Following is the part of my linker script:=09 /////////////////////////////////////////////////////////////////=09 =2E =2E =2E .data 0x040000 : AT(_mdata)=09 {=20 _data =3D .;=09 *(.data)=20=09 _edata =3D .;=20=09 } > ram=09 .mydata1 0x040004 :=09 {=20 . . BYTE(1); LONG(1); QUAD(1); . . } > ram .mydata 0x040008 : {=20 . . BYTE(1); LONG(1); QUAD(1); . .=20=20=20 } > ram =2E =2E =2E //////////////////////////////////////////////////////////////////=09 Here "_mdata" is some address of ROM region.=09 All the above three sections are overlapping. User has miscalculated=09 the sizes of the sections (which can happen quite often) and hence=09 assigned the wrong VMAs.=09=20=09 Some sort of alert in the form of warning or error is expected.=09=20=09 Instead, different LMAs are assigned to the sections considering that they might be overlay sections. So no warning/error is=20=09=09 generated.=09=09 Following lines from the map file depict the same:=09=09 ///////////////////////////////////////////////////////////////////=09 =2E =2E =2E .data 0x00040000 0x8 load address 0x00000368 0x00040000 _data =3D . *(.data) .data 0x00040000 0x0 hwinit.o .data 0x00040000 0x8 sample.o 0x00040004 _z 0x00040000 _p .data 0x00040008 0x0 start.o .data 0x00040008 0x0 vects.o 0x00040008 _edata =3D . .mydata1 0x00040004 0xd load address 0x00000370 0x00040004 0x1 BYTE 0x1 0x00040005 0x4 LONG 0x1 0x00040009 0x8 QUAD 0x1 .mydata 0x00040008 0xd load address 0x0000037d 0x00040008 0x1 BYTE 0x1 0x00040009 0x4 LONG 0x1 0x0004000d 0x8 QUAD 0x1 . . . /////////////////////////////////////////////////////////////////////=09 >> Assign the LMA as well as the VMA.=09=09 Yes, VMA overlapping error can be generated by this.=09=09 But can't we add an additional check, whether the sections having=20=09 overlapped VMAs are overlay or not, before changing their LMAs? Regards, Deepen Mantri KPIT Cummins InfoSystems Ltd. Pune, India ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Free download of GNU based tool-chains for Renesas' SH, H8, R8C, M16C and M32C Series. The following site also offers free technical support to its users. Visit http://www.kpitgnutools.com for details.=20 Latest versions of KPIT GNU tools were released on February 6, 2007. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20 -----Original Message----- From: Alan Modra [mailto:amodra@bigpond.net.au]=20 Sent: Saturday, April 14, 2007 6:58 AM To: Deepen Mantri Cc: binutils@sources.redhat.com Subject: Re: No error for Linker Section Overlapping On Thu, Apr 12, 2007 at 06:51:26PM +0530, Deepen Mantri wrote: > What is the benefit of assigning distinct LMAs to the non-overlay > sections having overlapped VMAs?=20 The changes to lma assignment made using overlays considerably simpler. In particular, sections following an overlay area now don't need their LMAs set. > Is there any way to generate an overlapping error for > non-overlay/non-loadable > sections (such as .bss section),if there VMAs get overlapped? Assign the LMA as well as the VMA. --=20 Alan Modra IBM OzLabs - Linux Technology Centre