Re: PIC is wasteful

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 23 Jun 2011, Ian Lance Taylor wrote:

Agner Fog <agner@xxxxxxxxx> 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)

Symbol interposition means that the shared library is permit to define a
function "malloc" and to call that function itself.  However, if the
executable defines a function "malloc" itself, then all the calls in the
shared library should call the implementation in the executable, rather
than the implementation in the shared library.

Note that although symbols are interposable by default, functions are inlinable by default (at -O3) when their body is available, which can be surprising.

--
Marc Glisse


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux