Relative expressions and ASSERT
H.J. Lu
hjl.tools@gmail.com
Wed Jan 19 12:28:00 GMT 2011
On Wed, Jan 19, 2011 at 12:25 AM, Alan Modra <amodra@gmail.com> wrote:
> On Wed, Jan 19, 2011 at 06:48:51AM +0000, Maciej W. Rozycki wrote:
>> Is that intended behaviour? From your update to the manual I infer
>> otherwise and it looks to me like a mishandled case that slipped through,
>> but perhaps I'm missing something. Either way I find it plain wrong that
>> a difference of two symbols (both coming from/relative to the same
>> section) yields a plain number in GAS, but not in an LD script. Hmm...
>
> ld actually does follow the current ld.texinfo description. The two
> symbols are in the same section, so the operation (subtraction in this
> case) is performed on their offsets, yielding a result in the same
> section.
>
> Admittedly, this does lead to an odd result. Should we special case
> subtraction? Exclusive or too?
>
I got a linker regression report on symbol subtraction on x86. I am waiting
for a testcase.
--
H.J.
More information about the Binutils
mailing list