Concept of statically-linked shared library?
Ian Lance Taylor
ian@airs.com
Fri Dec 16 07:40:00 GMT 2005
"sean yang" <seanatpurdue@hotmail.com> writes:
> I the book "Linkers and Loaders" by levine, and here I have a
> question regarding a concept from it:
> With static Shared libraries, symbols are still bound to addresses at
> link time, but library code is not bound to the executable until run
> time. The addresses of routines and data in the library are bound into
> the program.
>
> My question is:
> 1. It seems that current Linux ELF linker doesn't do this (statically
> linking shared library), right?
Correct. This is a COFF approach, not an ELF one.
> 2. Also, the author pointed out, this static shared library mechanism
> gives better runtime performance than dynamic linked shared library,
> which I understand because of little indirection. I wonder for
> performance critical code, Linux should be able to provide this
> linking mechanism.
GNU/Linux uses the prelinking mechanism instead. Try "man prelink".
Static linking of shared libraries is workable for exactly one shared
library: libc. Each additional shared library requires its own
separate address space, which very rapidly gets very hard to manage.
That's why it was abandoned in the move from COFF to ELF.
Ian
More information about the Binutils
mailing list