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: Avoid a spurious "*ABS*" symbol (was: Re: stage one of gas relocrewrite)


On Mon, 2 Sep 2002, Alan Modra wrote:
> On Sun, Sep 01, 2002 at 06:22:13PM -0400, Hans-Peter Nilsson wrote:
> > I'm confused; it looks like the code and comment has things
>
> Sorry for the lack of clarity.  The comment is in adjust_reloc_syms,
> but the place where we really need to add the symbol is in
> fixup_segment, on pcrel fixups.

Sure but it's still done in adjust_reloc_syms.  BTW, I was
referring to the code when I said it had things mixed up;
referring to BFD as a reason to set fx_addsy looks bogus.

> > - Do you (Alan and other people) agree this (handling fx_addsy
> >   NULL for fixups for constant expressions -- usually fx_pcrel)
> >   is the right route?
>
> Well, in some ways having the abs symbol is a hack.  However, the
> common case is that relocations have a symbol.

The fx_addsy is in a fixup, and sometimes fixups *don't* have a
symbol.  So requiring it for pcrel fixups (that need to turn
into relocations) is a special case.  Ports that need tweaking
(if any) should only need it in tc_gen_reloc and md_apply_fix3
(as for tc-mmix.c).

>  By not putting a
> symbol on pcrel fixups, where we do want a reloc, we will probably
> require code in lots of places to test for this case.  I'm inclined to
> say no, unless you can prove me wrong about the extra code.

The patch that was in that message was meant to prove that.
Didn't it?

(The cleanups I referred to were meant to imply local code
changes avoiding chaining if:s and using available variables
rather than multiple fixP->fx_this_and_that references; no
wide-scale stuff like reloc rewrites. ;-)

brgds, H-P


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