This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: About GOT (and PLT) limitations for PowerPC 32-bit
- From: "yon ar c'hall" <yon dot ar dot chall at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 2 Oct 2012 11:56:45 +0200
- Subject: Re: About GOT (and PLT) limitations for PowerPC 32-bit
- References: <CAOJvutNTmL=c=uQcxCYjUSopaYbJdWjZSfkvHbYreEyYn=-gsQ@mail.gmail.com> <20120929042643.GA3176@bubble.grove.modra.org>
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