The fastbind command performs analysis on the symbols used to bind an executable and all of its dependent shared libraries, and stores this information in the executable file. The next time the executable is run, the dynamic loader (/usr/lib/dld.sl for 32-bit mode or /usr/lib/pa20_64/dld.sl for 64-bit mode) detects that this information is available, and uses it to bind the executable instead of using the standard search method for binding the symbols.

Because fastbind writes the fastbind information in the executable file, you must have write permission on the executable file. If the executable file being analyzed is being run as another process or the file is locked against modifications by the kernel, the fastbind command fails.

If the shared libraries that an executable is dependent on are modified after the fastbind information is created, the dynamic loader silently reverts to standard search method for binding the symbols. The fastbind information can be re-created by running fastbind on the executable again. The fastbind command automatically erases the old fastbind information and generate the new one.

To

Use the option

 

 

Remove the fastbind information from the executable, returning it to the same state it as was in

-n

before you ran fastbind on it.

 

 

 

Normally, if fastbind detects any unsatisfied symbols while building the fastbind information,

-u

it generates an error message and does not modify the executable file. When you invoke

 

fastbind with the -uoption however, it allows unresolved symbols.

 

 

 

The 32-bit mode fastbind command does not work with EXEC_MAGIC executables.

The fastbind command effectively enforces the binding modes bind-restricted and bind-immediate. For example, consider an executable linked bind-deferred, which calls a function foo() defined in an implicitly loaded library. Before the actual call is made, if it explicitly loads a shared library (using shl_load(3X) with BIND_FIRST) having a definition for foo() when foo() is finally called, it is resolved from the explicitly-loaded library. But after running fastbind, the symbol foo() is resolved from the implicitly-loaded library.

For more information about fastbind and performance, see “Improving Shared Library Start-Up Time with fastbind” (page 222) .

Example 14 Improving Program Start-up with fastbind(1)

To run fastbind on the executable file a.out: $ fastbind a.out

To remove the fastbind information from the executable file a.out: $ fastbind -n a.out

Finding Object Library Ordering Relationships with lorder(1)

The lorder command finds the ordering relation for an object library. You can specify one or more object or archive library files (see ar(1)) on the command line or read those files from standard input. The standard output is a list of pairs of object file names, meaning that the first file of the pair refers to external identifiers defined in the second.

You can process the output with tsort to find an ordering of a library suitable for one-pass access by ld (see tsort(1) and ld(1)). The linker ld is capable of multiple passes over an archive in the archive format and does not require that you use lorder when building an archive. Using the lorder command may, however, allow for a slightly more efficient access of the archive during the link-edit process.

The symbol table maintained by ar allows ld to randomly access symbols and files in the archive, making the use of lorder unnecessary when building archive libraries (see ar(1)).

Finding Object Library Ordering Relationships with lorder(1) 77