294 Chapter 8
Ways to Improve Performance
Improving Shared Library Start-Up Time with fastbind
Invoking fastbind from the Linker
To invoke fastbind from ld, pass the request to the linker from your
compiler by using the -Wl,+fb options. For example:
$ ld -b convert.o volume.o -o libunits.sl Build the shared library.
$ cc -Aa -Wl,+fb main.c -o main \ Link main to the shared
libunits.sl -lc library. Perform fastbind.
The linker performs fastbind after it creates the executable file.
How to Tell if fastbind Information is Current
By default, when the dynamic loader finds that fastbind information is
out-of-date, it silently reverts back to the standard method for binding
symbols. To find out if an executable file has out-of-date fastbind
information, set the _HP_DLDOPTS environment variable as follows:
$ export _HP_DLDOPTS=-fbverbose
$ main
/usr/lib/dld.sl: Fastbind data is out of date
The dynamic loader provides a warning when the fastbind information
is out-of-date.
Removing fastbind Information from a File
To remove fastbind information from a file, use the fastbind tool with
the -n option. For example:
$ fastbind -n main Remove fastbind information from main.
Turning off fastbind at Run Time
To use the standard search method for binding symbols, instead of the
fastbind information in an executable file, set the _HP_DLDOPTS
environment variable as follows:
export _HP_DLDOPTS=-nofastbind Turns off fastbind at run time.
For More Information:
See the fastbind(1) man page.