so_needed directive
Syntax
so_needed { objectname };Parameters
| The name of a shared object that this shared object depends on. |
Description
Use this directive to set up a dependency for a shared object (referred to as the current shared object).
The .dynstr section of the current shared object will contain the name of the other shared object, and the .dynamic section of the current shared object will contain a DT_NEEDED key whose value is the index (in .dynstr) of the other shared object’s name.
The dependency information is used by the dynamic linker to ensure that a shared object operates in an environment where it has access to everything it needs.
Example
so_needed { otherLibrary.so };This configures a dependency so that the generated shared object needs the shared object otherLibrary.so. Exactly what happens if otherLibrary.so is not available when the shared object is loaded depends on the dynamic linker.