Subject: Re: why ld.elf_so is slow starting mozilla
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-toolchain
Date: 10/03/2002 08:51:11
> > I used to build a shared library by compiling it as one big piece.
> > That way it was possible to get all the internal references to be
> > to local symbols and fixed up by PC relative calls by the compiler.
> > Setting it up for libc would be a little tedious though.
>
> And, unfortunately, it would be a tedious waste of time, because it
> wouldn't work. If the symbols are exported, calls to them would still
> go through the PLT and have to be fixed up, even if they're in the
> same module.
No - because I used local symbols for internal calls even when
the function was exported.
Most functions (in libc) would require 3 labels (say):
_xxxx global for programs that use the header file
xxxx weak, global for other programs
__xxxx local for internal use
Getting all the aliases defined is left as an exercise
to the reader.
Another option would be do use the definitions in namespace.h
to fixup most internal references after an initial 'ld -r'
of the libc objects.
At the same time all the non-public global symbols could be
removed.
David
--
David Laight: david@l8s.co.uk