Re: use shared lib of libbackend.so

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

 



kevin diggs <diggskevin38@xxxxxxxxx> writes:

> On Sat, Apr 2, 2011 at 12:37 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
>>
>> I'm kind of surprised that it is twice as slow. ÂBut it is true that on
>> an ELF system shared libraries are always slower than static libraries,
>> though the slowdown is normally more on the order of 5%.
>>
> Is this a characteristic of ELF? Or how 'most' processors have to
> implement PIC in ELF (i.e. could a ... better designed processor have
> the same performance?)?

It's a characteristic of ELF.  In a shared library, all calls to
globally visible functions have to go through the PLT.  All references
to global variables have to go through the GOT.  Some slowdown is
inevitable.  You can adjust somewhat by using symbol visibility, but
that would be somewhat painful in the gcc source code base, and the gain
would be minimal.

Ian



[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