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

--- Comment #10 from Alan Modra <amodra at gmail dot com> ---
Regarding the interaction between --gc-sections and --as-needed, yes it would
be possible to run a pass over as-needed dynamic objects after garbage
collection to check whether their symbols are still needed.  This might be a
lot of work for little gain, and to do better than just removing DT_NEEDED
entries would basically require iterating the link.  (A dynamic object
reference to symbols in the executable or shared library being linked marks the
sections of those symbols against garbage collection.) 

Here's a comment from gcc/cp/mangle.c that should help explain the various
destructor symbol variations.

/* Handle destructor productions of non-terminal <special-name>.
   DTOR is a destructor FUNCTION_DECL.

     <special-name> ::= D0 # deleting (in-charge) destructor
                    ::= D1 # complete object (in-charge) destructor
                    ::= D2 # base object (not-in-charge) destructor  */

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to