12.9 --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 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.


The default is --as_needed.

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

Example 12-1 Examples

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

Non-ConfidentialPDF file icon PDF versionARM DUI0474M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.