Kenwood HP 9000 Personal Computer User Manual


 
6
Contents
Global Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
External References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Compiler-Linker Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Linking Programs on HP-UX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
The crt0.o Startup File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
The a.out File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
File Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Linking with Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Library Naming Conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Default Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
The Default Library Search Path. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Link Order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Running the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Loading Programs: exec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Binding Routines to a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Deferred Binding is the Default. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Linker Thread-Safe Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3. Linker Tasks
Using the Compiler to Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Changing the Default Library Search Path with -Wl, -L . . . . . . . . . . 53
Getting Verbose Output with -v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Passing Linker Options from the Compiler Command with -Wl . . . . 54
Renaming the Output File with -o . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Specifying Libraries with -l . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Suppressing the Link-Edit Phase with -c . . . . . . . . . . . . . . . . . . . . . . 55
Using Linker commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Linking with the 32-bit crt0.o Startup File . . . . . . . . . . . . . . . . . . . . . 57
Changing the Default Library Search Path with -L and LPATH. . . . 57