96 Chapter 3
Linker Tasks
Using 64-bit Mode Linker Options
Ignoring Dynamic Path Environment
Variables with +noenvvar
Use the +noenvvar to instruct the dynamic loader not to look at the
environment variables relating to dynamic path searching at runtime. It
ignores LD_LIBRARY_PATH and SHLIB_PATH environment variables.
This option is on by default in with ld +compat. It is off by default with
ld +std.
For example, if libbar.sl has dependent library libfee.sl that is i
./ at link time, but is moved to /tmp by runtime:
ld main.o -L. -lbar -lc
export LD_LIBRARY_PATH=/tmp
mv libbar.sl /tmp
a.out
called bar()
called fee()
mv /tmp/libbar.sl ./
ld main.o +noenvvar -L. -lbar -lc
mv libbar.sl /tmp
a.out
dld.sl: Unable to find library “libbar.sl”
Linking in 64-bit Mode with +std
Use the +std option to instructs the linker to do a 64-bit mode link. This
is the default mode. For more information, see “Using the 64-bit Mode
Linker with +compat or +std”.
Linking in 32-bit Mode Style with +compat
Use the +compat option to instruct the linker to do a 32-bit mode style
link. For more information, see “Using the 64-bit Mode Linker with
+compat or +std”.
Controlling Output from the Unwind Table
with +stripwind
Use the +stripunwind option to suppress output of the unwind table.
ld -b foo.o -o libfoo.sl +stripunwind
elfdump -U libfoo.sl
libfoo.sl: