bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/24836] --as-needed leaves unused direct dependencies


From: amodra at gmail dot com
Subject: [Bug ld/24836] --as-needed leaves unused direct dependencies
Date: Tue, 30 Jul 2019 02:10:49 +0000

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.


reply via email to

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