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: use shared lib of libbackend.so


kevin diggs <diggskevin38@gmail.com> writes:

> On Sat, Apr 2, 2011 at 12:37 PM, Ian Lance Taylor <iant@google.com> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]