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: pc-relative relocs on alpha


On Wed, Sep 18, 2002 at 09:15:56AM -0700, Richard Henderson wrote:
> I tried working my way through fixup_segment.  The bits around
> line 2673 that convert the subtraction to a pc-relative fixup
> look ok, but then we get down to line 2718 and apply
> MD_PCREL_FROM_SECTION a second time, which is where things appear
> to fall over.

You've hit an area of fixup_segment that I'm still not happy with,
but wasn't game to change in any major way.  Note that the two
applications of MD_PCREL_FROM_SECTION here cancel each other.  (At
least that seems to be the intention.  See hacks in the arm backend
md_pcrel_from, which is one of the reasons I didn't want to change
this code too much.)  What _has_ changed here is that the new code
consistently folds symbol values back into fx_offset when removing
fx_subsy and/or fx_addsy.

> I _think_ the following patch may be necessary, but I'm not sure.
> (Certainly the last time I fiddled with all this it was via trial
> and error.)  The fact to consider here is the branch relocations
> need to be relative to the end of the instruction rather than the
> beginning.

My opinion is that md_pcrel_from is _not_ the place to make such
hacks.  In any case, I don't think it will work as md_pcrel_from
only affects add_number passed to md_apply_fix3, not fx_offset,
and alpha doesn't seem to use fx_addnumber to pass anything around.
You probably need something to handle this case in tc_gen_reloc,
or something in alpha_validate_fix..

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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