[lld] [ELF] Demote symbols in /DISCARD/ discarded sections to Undefined (PR #69295)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 12:21:02 PDT 2023


================
@@ -3023,7 +3056,6 @@ void LinkerDriver::link(opt::InputArgList &args) {
 
   // Garbage collection and removal of shared symbols from unused shared objects.
   invokeELFT(markLive,);
-  demoteSharedAndLazySymbols();
----------------
MaskRay wrote:

No effect. demoteSharedAndLazySymbols was here to be clear that it needs to be done after markLive, which handles `--as-needed` DSOs. After markLive, these passes are mostly symbol agnostic. `demoteSharedAndLazySymbols` can be moved very late, even to Writer.cpp.

Hmm, I'm going to make a change to move `demoteSharedAndLazySymbols` to Writer.cpp.

https://github.com/llvm/llvm-project/pull/69295


More information about the llvm-commits mailing list