| |||
| Home > Linker command-line options > --as_needed, --no_as_needed | |||
Controls whether or not a reference to a shared library is added to the DT_NEEDED tags.
The effect of this option depends on the position on the armlink command-line, and applies only to subsequent dynamic shared objects:
--as_needed adds references to
subsequent shared objects to the DT_NEEDED tags only if the shared
objects are used to resolve symbols
--no_as_needed unconditionally
adds references to the DT_NEEDED tags.
The default is --as_needed.
However, if you specify --arm_linux, the
default is --no_as_needed.
The following example unconditionally adds a reference to liby.so in
the DT_NEEDED tags, but only adds tags for libx.so and libz.so if
they are used to resolve symbols:
armlink ... libx.so --no-as-needed liby.so --as-needed
libz.so