Chapter 8 293
Ways to Improve Performance
Improving Shared Library Start-Up Time with fastbind
Improving Shared Library Start-Up
Time with fastbind
The fastbind tool improves the start-up time of programs that use
shared libraries. When fastbind is invoked, it caches relocation
information inside the executable file. The next time the executable file
runs, the dynamic loader uses this cached information to bind the
executable instead of searching for symbols.
The syntax for fastbind is:
fastbind [ -n] [ -u] incomplete executable…
where:
-n Removes fastbind data from the executable.
-u Performs fastbind even when unresolved symbols are
found. (By default, fastbind stops when it cannot
resolve symbols.)
Using fastbind
You can create and delete fastbind information for an executable file
after it has been linked with shared libraries. You can invoke fastbind
from the linker or use the fastbind tool directly. You can set the
_HP_DLDOPTS environment variable to find out if fastbind information
is out-of-date and to turn off fastbind at run time.
Invoking the fastbind Tool
To invoke fastbind on an incomplete executable file, verify that your
executable has write access (because fastbind writes to the file) and then
run fastbind.
$ ls -l main
-rwxrwxrwx 1 janet 191 28722 Feb 20 09:11 main
$ fastbind main
The fastbind tool generates fastbind information for main and
rewrites main to contain this information.