Roland Mainz wrote: > Assuming I have application "foo" which originally only depended on > libc.so.1 and now I have a new version of "foo" which requires us to > load two more shared libraries (called libxxx1.so.1 and libyyy2.so.9) > ... is there a way to reduce the additional startup time needed to load > these libraries ? The linker already uses -Bstatic which implies > "lazyload" ... is there anything else we can do ?
I assume you meant -Bdirect, which also enables -z lazyload. You're libraries libxxx1.so.1 and libyyy2.so.9 should also be built with -Bdirect. This options requires ld.so.1 to do far less "searching" for symbols to resolve relocations. Lazy loading can defer an objects loading, which helps start up performance, but you'll eventually pay the cost of loading the object when it is first referenced. Another aid is versioning your objects. Use a mapfile to define the exported interface, and thus reduce any other global symbols to locals. This can greatly reduce the number of relocations that are left for ld.so.1 to process. Make sure each object is "ldd -Ur" clean. ie. there are no errors/warnings from running this command on your objects. -- Rod