Re: optimize __gp location

David Mosberger
2005-01-24T17:51:12Z

>>>>> On Fri, 21 Jan 2005 15:22:18 -0800, "Chen, Kenneth W" <kenneth.w.chen@intel.com> said:

Ken> Can we position the __gp somewhat more optimally, to cover more of these
Ken> symbols? Something like the following patch would make all of them fall
Ken> into the 22-bit immediate offset relative to gp.

The position was chosen to maximize the amount of data that can be
addressed via the GOT. As you observe, that doesn't maximize the
amount of data that can be addressed in a GP-relative fashion.

It might be best to just remove the __gp definition. In that case,
the linker will automatically choose a value and it ought to be able
to choose an optimal value.

--david