This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Lazy binding of virtual table entries?
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Antti Kerola <antti dot kerola at uta dot fi>
- Cc: binutils at sources dot redhat dot com
- Date: 08 Nov 2004 14:00:26 -0500
- Subject: Re: Lazy binding of virtual table entries?
- References: <6.0.3.0.0.20041108000619.0284d620@imap.uta.fi>
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