This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PIC is wasteful


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]