You copied the Doc URL to your clipboard.

--as_needed, --no_as_needed

Controls whether or not a reference to a shared library is added to the DT_NEEDED tags.

Usage

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 the DT_NEEDED tags only if the subsequent shared objects are used for resolving symbols

  • --no_as_needed unconditionally adds references to the DT_NEEDED tags.

Default

The default is --as_needed.

However, if you specify --arm_linux, the default is --no_as_needed.

Example

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 for resolving symbols:

armlink ... libx.so --no-as-needed liby.so --as-needed libz.so

Was this page helpful? Yes No