Lazy binding of virtual table entries?
Ian Lance Taylor
ian@wasabisystems.com
Mon Nov 8 19:00:00 GMT 2004
Antti Kerola <antti.kerola@uta.fi> writes:
> We have a rather large application, about 2 million lines of code, in
> about 80 shared libraries.
> I have found out with LD_DEBUG that relocation of virtual table
> entries in the shared libraries takes
> place at the start up. This is now taking several seconds. According
> to LD_DEBUG, all the
> other function bindings are performed lazily.
>
> - Is there a way to bind also the virtual table entries lazily?
No. I can't think of any way to do that without making virtual
function calls less efficient at runtime.
> - Alternatively, is there a way to prelink the executable so that the
> virtual table entries
> are resolved at link time without linking the whole app statically to
> one huge binary?
GNU/Linux has a prelinker which can do this. But the dynamic linker
has to recognize the prelinking, and presumably the Solaris dynamic
linker won't recognize what the GNU/Linux prelinker does. I don't
know whether Sun provides any similar prelinking functionality for
Solaris.
Ian
More information about the Binutils
mailing list