This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PR20989, sparc GOT sequence optimization
- From: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- To: Alan Modra <amodra at gmail dot com>
- Cc: binutils at sourceware dot org, Rainer Orth <ro at gcc dot gnu dot org>, "David S. Miller" <davem at davemloft dot net>
- Date: Mon, 02 Jan 2017 13:46:00 +0100
- Subject: Re: PR20989, sparc GOT sequence optimization
- Authentication-results: sourceware.org; auth=none
- References: <20161227030359.GE340@bubble.grove.modra.org> <878tqt3krr.fsf@oracle.com> <20170102113450.GK29355@bubble.grove.modra.org>
> +/* Return whether H is local and its ADDRESS is within 4G of
> + _GLOBAL_OFFSET_TABLE_ and thus the offset may be calculated by a
> + sethi, xor sequence. */
>
> Generally speaking the address must be within {+-}2G of
> _GLOBAL_OFFSET_TABLE_, i.e. there can be negative offsets.
I allowed +/-4G, and believe that is the range of sethi, xor.
sethi %hi(-1), %l7 # 0x0000 0000 ffff fc00
xor %l7, -0x400, %l6 # 0xffff ffff 0000 0000
xor %l7, 0x3ff, %l5 # 0x0000 0000 ffff ffff
I stand corrected. In 64-bits the range is indeed a signed 33-bit
constant.