[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/26551] A definition referenced by an unneeded (--as-needed) shar
i at maskray dot me
[Bug ld/26551] A definition referenced by an unneeded (--as-needed) shared object should be exported
Sat, 29 Aug 2020 19:39:51 +0000
--- Comment #3 from Fangrui Song <i at maskray dot me> ---
When --as-needed is in action, a shared object is added as a DT_NEEDED tag if
it satisfies a non-weak undefined reference from a regular object (surviving
under --gc-sections). This is the main use case of the option.
Apparently in GNU ld, --as-needed is also used to decide whether a definition
needs to be exported. I think it'd be good if this task can be detached from
--as-needed (like gold).
For an "unneeded" (in terms of --as-needed) shared object, it may be loaded by
other shared objects.
Adding the shared object on the command line is an explicit intention that the
"unneeded" (unneeded by the executable, but
may be needed by other shared objects) may require some definitions to be
exported. (The definitions may be statically known (by transitive loading of
shared objects; the behavior is related to --copy-dt-needed-entries) or dynamic
You are receiving this mail because:
You are on the CC list for the bug.