| |||
| Home > Linker Command-line Options > Command-line options listed alphabetically > --add_needed, --no_add_needed | |||
This option 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.
Example 2.1 shows how to use this option.
Example 2.1. --[no_]add_needed options
Assuming 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.
Use the following command-line options:
armlink --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.