From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12299 invoked by alias); 26 Dec 2007 21:40:57 -0000 Received: (qmail 12287 invoked by uid 22791); 26 Dec 2007 21:40:55 -0000 X-Spam-Check-By: sourceware.org Received: from omta05sl.mx.bigpond.com (HELO omta05sl.mx.bigpond.com) (144.140.93.195) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Dec 2007 21:40:49 +0000 Received: from oaamta07sl.mx.bigpond.com ([58.174.193.185]) by omta05sl.mx.bigpond.com with ESMTP id <20071226214045.CLUC19939.omta05sl.mx.bigpond.com@oaamta07sl.mx.bigpond.com> for ; Wed, 26 Dec 2007 21:40:45 +0000 Received: from bubble.grove.modra.org ([58.174.193.185]) by oaamta07sl.mx.bigpond.com with ESMTP id <20071226214045.IZNM24011.oaamta07sl.mx.bigpond.com@bubble.grove.modra.org>; Wed, 26 Dec 2007 21:40:45 +0000 Received: by bubble.grove.modra.org (Postfix, from userid 500) id 62AB53DBF5B; Thu, 27 Dec 2007 08:10:45 +1030 (CST) Date: Wed, 26 Dec 2007 21:40:00 -0000 From: Alan Modra To: Nick Clifton Cc: binutils@sourceware.org Subject: Re: LMA XXX Overlaps Previous Sections When Using PHDRS Message-ID: <20071226214045.GB23286@bubble.grove.modra.org> Mail-Followup-To: Nick Clifton , binutils@sourceware.org References: <3517CACAE247DD498B74D4B65A379E95270856@corpcboemb01.edocorp.com> <476FEA82.1070501@redhat.com> <20071225230849.GA23286@bubble.grove.modra.org> <4772A539.8050906@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4772A539.8050906@redhat.com> User-Agent: Mutt/1.5.9i 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: 2007-12/txt/msg00149.txt.bz2 On Wed, Dec 26, 2007 at 07:02:17PM +0000, Nick Clifton wrote: > Hi Alan, > > >>This is a bogus error message due to a spurious check in the linker. > > > >Eh? I think the error message is correct. We really do have an error > >of some sort here, most likely the linker ignoring phdr "AT" when > >assigning section lmas in ldlang.c. > > Ok - can you explain what that piece of code was doing then ? I could not > work out what it was trying to achieve. The linker sets up section vma and lma, and section to segment mapping well before assign_file_positions_for_load_sections. In cases where the segment (program header) p_paddr is set, it ought to match the first section lma mapped to that segment. The same goes for p_vaddr and section vma. (Both can be offset by some amount, for file header and program header space, but this is the general idea.) After adding the first section to the segment, we increase p_memsz to account for space taken by that section. Any following section in that segment can't start before the end of the previous section. ie. for lma, section lma must be greater than p_paddr + p_memsz. The same goes for vma and p_vaddr + p_memsz but it doesn't look like we check that.. There can of course be gaps between sections, but overlap is an error. The testcase is failing the consistency check on the first section due to section lma disagreeing with header p_paddr. -- Alan Modra Australia Development Lab, IBM