ARM position-independent code problem

Andrew Haley aph@redhat.com
Mon Feb 4 13:46:00 GMT 2019


On 2/1/19 3:05 PM, David Sherman wrote:

> Is that the trick?  Once I took out the static keyword, the second
> one did access correctly.  So am I correct in learning that static
> variables within a module that is to be position-independent cannot
> be statics?

Yeah, that makes sense. GCC is assuming that data declared as static
will be directly accessed. But, but... how are they accessed? Can you
show us the code that is generated? Which Arm variant is this?

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Gcc-help mailing list