bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/26551] A definition referenced by an unneeded (--as-needed) shar


From: i at maskray dot me
Subject: [Bug ld/26551] A definition referenced by an unneeded (--as-needed) shared object should be exported
Date: Sat, 29 Aug 2020 19:39:51 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26551

--- 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
(dlopen).)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]