About GOT (and PLT) limitations for PowerPC 32-bit
yon ar c'hall
yon.ar.chall@gmail.com
Tue Oct 2 09:56:00 GMT 2012
Thanks for answering, Alan.
On Sat, Sep 29, 2012 at 6:26 AM, Alan Modra <amodra@gmail.com> wrote:
> On Tue, Sep 25, 2012 at 09:01:33PM +0200, yon ar c'hall wrote:
>> In "per functions", I don't actually understand what "function" refers
>> to. I mean it would sound odd to me that it refers to some C function.
>
> It does. ppc32 sets up the got pointer reg on entry to a function.
> With -fPIC code you get a separate GOT for each function, so each
> function can have up to 64k of GOT entries. With -fpic code, a single
> GOT is used per executable.
Don't you mean 16K of GOT entries (and 64KB of GOT size) ?
I tried to compile with gcc-4.4.1 (-c -fPIC -O2) a dummy .cc with 20k
of global integers (int data00000 to int data20000), and two functions
accessing each a half of them (simply ++dataxxxx) : it failed with
many "Error: operand out of range (0x000000000000xxxx is not between
0xffffffffffff8000 and 0x0000000000007fff)" messages. Also, it's
binutils-2.19.
Did I misread your "GOT per function" explanation, and used a wrong
code example ?
Another thing : I also noticed that strings literal (puts(__FILE__);
puts("foo bar");...) are accessed via the GOT. is it normal ?
Thanks again,
Yon
More information about the Binutils
mailing list