tech-toolchain archive

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

Re: backing out rev. 1.2 of external/gpl3/binutils/dist/gas/write.c

> On Dec 31, 2009, at 8:58 PM, Izumi Tsutsui wrote:
> >> So please do not back out the change.
> >=20
> > But then netbsd-5-0 and netbsd-5 builds are broken with it.
> > Is there any other workaround for it?
> The change I just committed to my mips64 branch and HEAD should fix it =
> while making mips64 happy.=

What is the intention of the change?  (I guess the comment `Never
... non-negative addend' is a typo of `Never ... negative addend')

1) In the expression `S_GET_VALUE(sym) + fixp->fx_offset <
   S_GET_VALUE(sym)', both S_GET_VALUE() and fx_offset are relative
   and unsinged value, so it doesn't always detect the negative case.

   In case of vis.c on x86_64, the former is 0x000000000000001d and
   the latter is 0xfffffffffffffffb so it happen to work, but...

2) I guess the original meaning of the code is to keep `symbol +
   offset' as is so that linker can use the `symbol' as a hint to
   adjust the relocation after merging object in the merge section.
   If so we should retain it even if offset is positive.

   And if I change the malloc() argument in the vis.c from (x - y + 5)
   to (x - y - 5), gcc (cc1) actually produce $LC2 + 5.  So, this
   means potentially current toolchain (cc + as + ld) still may
   produce incorrect object.


Home | Main Index | Thread Index | Old Index