public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Stephane Carrez <stcarrez@nerim.fr>
To: Alan Modra <amodra@bigpond.net.au>
Cc: Stephane Carrez <stephane.carrez@free.fr>, binutils@sources.redhat.com
Subject: Re: [PATCH]: HC11 linker relax fixes (potential pb on other relax targets)
Date: Wed, 09 Apr 2003 22:10:00 -0000	[thread overview]
Message-ID: <3E949A50.2080005@nerim.fr> (raw)
In-Reply-To: <20030408124117.GD1189@bubble.sa.bigpond.net.au>

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


      reply	other threads:[~2003-04-09 22:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04 21:19 Stephane Carrez
2003-04-08 12:41 ` Alan Modra
2003-04-09 22:10   ` Stephane Carrez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E949A50.2080005@nerim.fr \
    --to=stcarrez@nerim.fr \
    --cc=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=stephane.carrez@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).