PIC is wasteful
Marc Glisse
marc.glisse@inria.fr
Fri Jun 24 10:46:00 GMT 2011
On Fri, 24 Jun 2011, Agner Fog wrote:
> On 23-06-2011 22:02, Marc Glisse wrote:
>> On Thu, 23 Jun 2011, Ian Lance Taylor wrote:
>>
>>> Agner Fog <agner@agner.org> writes:
>>>
>>>> I wonder why position-independent code (PIC) and global offset tables
>>>> (GOT) are used in shared objects (.so) when these features are wasting
>>>> resources and apparently unnecessary. The wasteful use of PIC and GOT
>>>> in Linux is apparent in the following questions:
>>
>> Do you mean you would like -Bsymbolic to be the default ? (or maybe
>> Solaris' -Bdirect)
>
> Thanks for the tip about -Bsymbolic, that's what I want, but it doesn't seem
> to do the job.
> When I compile with -Bsymbolic -fpic I still get a GOT entry in 64 bit mode.
I just tried (linux amd64) on a trivial lib with 2 functions where the
second calls the first. And -Bsymbolic made the entry for the first
function disappear from the .rela.plt section. So it makes some difference
at least.
--
Marc Glisse
More information about the Gcc-help
mailing list