This is the mail archive of the binutils@sourceware.org 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: Relative expressions and ASSERT


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.


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