brian.lu wrote:
> Hi, experts,
> 
> We met a problem when tuning firefox startup performance. The issue is:
> NSPR shared library (which is used by Firefox)  exports an interface (a 
> function name) to the applications (like Firefox).  Applications can 
> provide a implementation of that function to override some
> function provided by NSPR.  Firefox doesn't use that interface. I.e. it 
> doesn't define that symbol.
> 
> But every time, when firefox starts, NSPR lookups that symbol by using 
> dlsym(). That takes some time and fails finally.  We can't modify the 
> NSPR codes
> because it is not part of firefox code base.
> Does ld.so.1 provide some mechanism that we can void looking up this 
> symbol in firefox?

Presumably you're referring to:

21799: 1: file=0;  dlopen() called from file=/usr/lib/mps/libnspr4.so \
   [ RTLD_LAZY RTLD_LOCAL RTLD_GROUP RTLD_WORLD ]
......

21799: 1: symbol=nspr_use_zone_allocator;  dlsym() called from \
   file=/usr/lib/mps/libnspr4.so; starting at file=/usr/lib/firefox/firefox-bin
......

Which then looks for the symbol in every dependency that has so far been
loaded, and then causes a bunch of pending lazy-loaded objects to be brought
in in an attempt to find the symbol?

And you can't change libnspr to either use dlopen(0, RTLD_FIRST), or use
dlsym(RTLD_PROBE)?

Could you not provide nspr_use_zone_allocator() as some null routine in
firefox?

Hmmm, the idea of defining a symbol within an object, and then tagging
it in some way as "does-not-exist" such that a symbol lookup would
be aborted when this symbol is found, is an idea to chew on :-)

-- 

Rod.

Reply via email to