Feature #2704
openld could translate --as-needed to -z ignore
50%
Description
GNU ld has an option, --as-needed to only record dynamic dependencies for libraries which are actually referenced.
We have -z ignore which does the same thing, but also ignores unreferenced ELF sections from relocatable objects.
In practice, it should be safe to map --as-needed to -zignore for GNU compatibility. The risk would be to applications which had unreferenced ELF sections which they nevertheless wished to be represented in output and had discovered and passed --as-needed and did so in a way which positionally affected the input object.
This is unlikely.
The obvious code is available from:
https://github.com/richlowe/illumos-gate/compare/ld/as-needed
Updated by Rich Lowe almost 10 years ago
It should be mentioned that while we can do this part, it doesn't actually help for the specific case in which it is desired, because of some other issues related to C++ exception handling.
Implementing this actually makes the case we care about worse, unless that is fixed
Updated by Andrew Stormont about 7 years ago
- Blocks deleted (Bug #3062: illumos should build/work with GCC 4.6 or newer)