Method and apparatus for optimization of an executable program that calls
procedures in a shared library. Code segments that read procedure address information
from a linkage table are first identified. Each linkage code segment is associated
with a call to a procedure in the shared library, and the address information in
the linkage table is associated with the procedures in the shared library. During
program execution, the address information is read from the linkage table and substitute
code segments are generated for the linkage code segments. Each substitute code
segment has direct loads of the address information for calling the associated
procedure instead of the original references to the linkage table. Thereafter,
the substitute code segments are executed instead of the linkage code segments.