This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PowerPC 32 : GOT access not optimized for DSO-scope static variable ?
- From: Alan Modra <amodra at gmail dot com>
- To: yon ar c'hall <yon dot ar dot chall at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Sat, 15 Jun 2013 20:46:36 +0930
- Subject: Re: PowerPC 32 : GOT access not optimized for DSO-scope static variable ?
- References: <CAOJvutOvApuQX7==J9czmqATAgU5LnWZ9tv2hybeE4ssr+ePxA at mail dot gmail dot com>
On Fri, Jun 14, 2013 at 04:37:27PM +0200, yon ar c'hall wrote:
> So is there any possible optimization regarding static DSO scope
> variables access (and variables with visibility=hidden as well) for
> PowerPC ?
It is possible, but gcc -m32 does not implement this sort of
optimisation. gcc -m64 does. eg.
.L.f1:
addis 9,2,static_var@toc@ha
lwz 3,static_var@toc@l(9)
extsw 3,3
blr
vs.
.section ".toc","aw"
.LC0:
.quad global_var
.text
.L.f2:
addis 10,2,.LC0@toc@ha
ld 9,.LC0@toc@l(10)
lwz 3,0(9)
extsw 3,3
blr
--
Alan Modra
Australia Development Lab, IBM