From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12269 invoked by alias); 9 Apr 2003 22:10:14 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 12262 invoked from network); 9 Apr 2003 22:10:13 -0000 Received: from unknown (HELO mallaury.noc.nerim.net) (62.4.17.103) by sources.redhat.com with SMTP; 9 Apr 2003 22:10:13 -0000 Received: from nerim.fr (stcarrez.net1.nerim.net [62.212.108.40]) by mallaury.noc.nerim.net (Postfix) with ESMTP id EDB8D62D02; Thu, 10 Apr 2003 00:10:09 +0200 (CEST) Message-ID: <3E949A50.2080005@nerim.fr> Date: Wed, 09 Apr 2003 22:10:00 -0000 From: Stephane Carrez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alan Modra Cc: Stephane Carrez , binutils@sources.redhat.com Subject: Re: [PATCH]: HC11 linker relax fixes (potential pb on other relax targets) References: <3E8DF6ED.7050605@free.fr> <20030408124117.GD1189@bubble.sa.bigpond.net.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00244.txt.bz2 Hi! Alan Modra wrote: > On Fri, Apr 04, 2003 at 11:19:41PM +0200, Stephane Carrez wrote: > >> - when we adjust the symbols after removing bytes, we must take into >> account the symbol that marks the end of the section. The test that >> exists >> in the bfd relax targets (and that I copied!) is: >> >> if (isym->st_shndx == sec_shndx >> && isym->st_value > addr >> && isym->st_value < toaddr) >> >> and it is not correct if there is a section that defines a label at its >> very end. >> It will not be adjusted. > > > I wonder why there is any test of symbol value against "toaddr"? It > seems to me that this test is bogus, and your replacement of "< toaddr" > with "<= toaddr" just fixes one particular symbol value. For instance, > suppose we have > > .text > nop > nop > sym1: > sym2 = sym1 + 2 > > and the relax pass decides to delete one of the nops. Shouldn't sym2 > be decremented? Of course, you could argue that > > sym3 = .text + 4 > > might be better left alone, but that just demonstrates the fragility > of adjusting symbols based on their value. > I agree. I don't know the rationale for the toaddr test. At least you give me one to remove it. Stephane