--as_needed, --no_as_needed

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

Show/hideUsage

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.

Show/hideDefault

The default is --as_needed.

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

Show/hideExample

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

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0493E
Non-ConfidentialID071611