mn10300: relaxing vs section merging
Alan Modra
amodra@bigpond.net.au
Wed May 26 00:02:00 GMT 2004
On Tue, May 25, 2004 at 07:14:34PM -0400, DJ Delorie wrote:
>
> > It doesn't look right to me. You are adding irel->r_addend to symval
> > where you previously did not.
>
> That's because _bfd_elf_rela_local_sym adjusts the addend according to
> where the symbol has been (so far) relocated to. That's the value we
> need for checking relax limits, so we need to add it in.
>
> I don't think "previously" counts here. It didn't work previously.
I guessed that's why you were adding irel->r_addend, but doing so will
be wrong for other symbols and relocations. Consider non SEC_MERGE
symbols, and note later code
value += irel->r_addend;
so now the addend is summed twice. That can't be correct.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list