11.5. Linker Optimizations

The linker (ld command) should rarely be called directly. For linking applications from a series of .a, .o, and .sl/.so files, the appropriate compiler should be used instead to do the linking. When using the compiler, it knows to provide certain runtime libraries for the linker based on the language. In most cases, the same compiler options used to compile the individual files can be used for the link step, but .o, .a, or shared libraries are specified instead of .c files. For linker specific options, the C or C++ compiler can be used to pass these options to the linker using the -Wl option.

11.5.1. Options When Linking Shared Libraries

The main linker option that should be used when compiling shared libraries is the ...

Get HP-UX 11i Tuning and Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.