This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: HC11 linker relax fixes (potential pb on other relaxtargets)


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]