This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] [MIPS] Ensure that local GOT entries accessed via a 16-bit index come first
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: Kwok Cheung Yeung <kcy at codesourcery dot com>, <binutils at sourceware dot org>, <jack dot carter at imgtec dot com>, <hjl dot tools at gmail dot com>
- Date: Thu, 17 Apr 2014 13:01:00 +0100
- Subject: Re: [PATCH] [MIPS] Ensure that local GOT entries accessed via a 16-bit index come first
- Authentication-results: sourceware.org; auth=none
- References: <534E84C2 dot 9050505 at codesourcery dot com> <87y4z5hy4c dot fsf at talisman dot default> <alpine dot DEB dot 1 dot 10 dot 1404162228520 dot 15259 at tp dot orcam dot me dot uk> <87ha5siikm dot fsf at talisman dot default>
On Thu, 17 Apr 2014, Richard Sandiford wrote:
> GCC doesn't produce them. I agree using GOT_PAGE/HI16 seems unlikely,
> especially since the sequence to load an address would then require 3
> instructions. I imagine in practice everyone just uses GOT_{HI,LO}16
> for all ABIs.
Yeah, as observed here and the cause of the issue we support
GOT_HI16/GOT_LO16 pairs (and also actually GOT16 with no LO16 counterpart)
for local symbols as well, making GOT_DISP redundant. And for GOT_PAGE we
have almost 16k pages worth 1GB of program space available before
GOT_PAGE/HI16 would load non-zero.
> I don't think this was your point, but just in case: even if something
> did use those in future, the patch is still a strict improvement over
> the current situation, in that it handles {GOT,CALL}_{HI,LO}16 better
> without changing the allocation scheme for the others. I don't think
> we should add extra code for compound GOT relocs without a patch to make
> GCC use them (which I'm not convinced is a good idea).
Of course it was not, the change is excellent work -- thanks, Kwok.
Maciej