DJ Delorie <[EMAIL PROTECTED]> writes:

> If I comment out the "&& offset == 0" line, gcc produces assembly like this:
>
>         l       %r2,[EMAIL PROTECTED](%r12)
>
> The assembler and linker don't seem to have a problem with that
> construct.  Are we deliberately avoiding it for some obscure reason,
> or is this just a bug that's never been tripped over before?

The GOT is an array of addresses, and [EMAIL PROTECTED] addresses one of these
addresses.  Thus [EMAIL PROTECTED] points to the address of a different and
unrelated variable, assuming it is still within the range of the GOT.

> If it's a bug, is there some test for a "reasonable" offset that we
> can add, that makes sense?

Since a GOT address is a pointer to an address it does not make sense to
add any offset to it.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to