bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -relax broken for SH assembler


From: Hans-Peter Nilsson
Subject: Re: -relax broken for SH assembler
Date: Sun, 1 Jul 2001 21:52:18 -0400 (EDT)

On 28 Jun 2001, Nick Clifton wrote:
> I believe that the patch below should fix this problem.  Since I am
> unfamilair with the SH assembler however, I am CC'ing this patch to
> the SH maintainers (Hi Joern, Hi Hans-Peter) in case they care to
> comment.

>From my cursory reading of the patch, tc-sh.c and elf32-sh.c, it
seems the patch does TRT (with the obvious removal of #if 0).

It's the location (number of loads of it), not a symbol, that
matters for BFD_RELOC_SH_COUNT, so doing the fixup relative to
fscan would have be right regardless of symbol frag lossage
(defragmentation?).

Though it looks like you could just replace
+              S_GET_VALUE (sym) - fscan->fx_frag->fr_address,
with
+              fscan->fx_where,
See the equality check in the end-condition of the for-loop ~60
lines above.  If that's wrong, then I'm probably way off about
the rest I say here too...

> My solution is to use the frag attached to the fixup associated
> with the original sym.  This frag should be in the same section as the
> sym, and I hope will cover the location of the sym, but I could not
> decide if this will always be true.  It certainly appears to be true
> for the test case above.

If I read the code right, it should be, as the purpose of fscan
seems to be acting as a fixup for the same address that sym
points to.

brgds, H-P




reply via email to

[Prev in Thread] Current Thread [Next in Thread]