Kenwood HP 9000 Personal Computer User Manual


 
94 Chapter 3
Linker Tasks
Using 64-bit Mode Linker Options
only load those modules from an archive library that is needed. The
mode you select, either by default or explicitly, remains on until you
change it.
+noforceload is the default on both 32-bit and 64-bit modes.
In the following example, main() references foo(), which is a module
in mylib.a. foo() doesn’t reference any other module in mylib.a and
libc.a. If mylib.a contains foo.o and bar.o, then only foo.o is
linked in.
ld crt0.o main.o +vtype libraries mylib.a -lc
...
Selecting liba.a[foo.o] to resolve foo
ld crt0.o main.o +forceload mylib.a -lc +vtype libraries
...
Selecting liba.a[foo.o] to forcibly load
Selecting liba.a[bar.o] to forcibly load
Flagging Unsatisfied Symbols with
+[no]allowunsats
Use the +allowunsats option to instruct the linker to not flag
unsatisfied symbols at link time. This is the default for relocatable (-r)
and shared library builds (-b), and is the default behavior in 32-bit
mode.
Use the +noallowunsat option to instruct the linker to flag as an error
any unsatisfied symbol in the resulting output file. The linker still
creates a.out, but the file does not have any execute permission bits set.
This is the default for program files (same behavior as in 32-bit mode).
For example, where main() references functions foo() and bar().
bar() resides in libbar.sl. foo() resides in libfoo.sl
ld main.o +allowunsats -L. -lbar -lc
ld: (warning) Unsatisfied symbol “foo”.
1 warning.
+allowunsats still causes the linker to emit a warning message and
output a.out. If you do not specify the option and the linker finds an
unsatisfied symbol, the linker emits an error message and an
unexecutable a.out only if linking with +compat set.
ld main.o -L. -lbar -lc
ld: Unsatisfied symbol “foo”.
1 error.