Kenwood HP 9000 Personal Computer User Manual


 
Chapter 3 93
Linker Tasks
Using 64-bit Mode Linker Options
Looks at the environment variables first, followed by RPATH, and the
default directories by default when doing dynamic path searching for
standard-mode dependentshared libraries.
Linking Shared Libraries with -dynamic
Use the -dynamic option to instruct the linker to look for shared
libraries first and then archive libraries. The linker outputs a
dynamically linked executable.
This option is on by default in standard mode.
In the following example, the linker only looks for shared libraries:
$ld main.o -dynamic -L. -lbar -lc
If you specified an archive library, the linker links it in, but the resulting
executable is still a dynamically linked executable. This is true even if
the linker finds no shared libraries at link time.
Linking Archived Libraries with -noshared
Use the -noshared option if you need to link with all archive libraries.
The linker outputs a statically bound executable.
NOTE You cannot link in shared libraries if you specify this option.
In the following example, the linker only looks for
/usr/lib/pa20_64/libfoo.a and /usr/lib/pa20_64/libc.a:
ld crt0.o main.o -noshared -L. -lfoo -lc
If you specify a shared library with this option, the linker emits an error
message.
ld: The shared library “libbar.sl” cannot be processed in a static
link.
Fatal error.
Controlling Archive Library Loading with
+[no]forceload
Use the +[no]forceload option to control how the linker loads object
files from an archived library. +forceload instructs the linker to load
all object files from an archive library. +noforceload tells the linker to