12.1 --add_needed, --no_add_needed

Controls shared object dependencies of libraries that are not specified on the command-line.


The --add_needed setting applies to any following shared objects until a --no_add_needed option appears on the command line. The linker adds all shared objects that the shared object depends on and recursively all of the dependent shared objects to the link.


If you are using the --arm_linux option then the default is --add_needed otherwise the default is --no_add_needed.


This example shows how to specify shared objects with dependencies. It assumes that the following dependencies exist:

  • cl1.so depends on dep1.so.
  • cl2.so depends on dep2.so.
  • cl3.so depends on dep3.so.
  • dep2.so depends on depofdep2.so.

For this example, use the following command-line options:

armlink --arm_linux --no_add_needed cl1.so --add_needed cl2.so --no_add_needed cl3.so

This results in the addition of the following shared objects to the link:

  • cl1.so.
  • cl2.so.
  • dep2.so.
  • depofdep2.so.
  • cl3.so.
Non-ConfidentialPDF file icon PDF versionARM DUI0474M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.