Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Linker and Libraries User's Guide: HP 9000 Computers > Chapter 8 Ways to Improve Performance

Improving Shared Library Start-Up Time with fastbind

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

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.

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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.