diff options
author | Reid Kleckner <rnk@google.com> | 2018-04-16 22:45:23 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-04-16 22:45:23 +0000 |
commit | 9c86a313076351134cd1e4f2a604466d7c0974b4 (patch) | |
tree | 00069135e40104c016b1e674ce8ef58d2e122727 /lld/ELF/Driver.cpp | |
parent | 9b294d1e905ab49c941333c81840afac9f6fe238 (diff) | |
download | bcm5719-llvm-9c86a313076351134cd1e4f2a604466d7c0974b4.tar.gz bcm5719-llvm-9c86a313076351134cd1e4f2a604466d7c0974b4.zip |
Revert r329960 "Do not keep shared symbols created from garbage-collected eliminated DSOs."
This is causing large numbers of Chromium test executables to crash on
shutdown. The relevant symbol seems to be __cxa_finalize, which gets
removed from the dynamic symbol table for some of the support libraries.
llvm-svn: 330164
Diffstat (limited to 'lld/ELF/Driver.cpp')
-rw-r--r-- | lld/ELF/Driver.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index c380ee56b23..539ef97a739 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -1059,18 +1059,6 @@ template <class ELFT> static void handleUndefined(StringRef Name) { Symtab->fetchLazy<ELFT>(Sym); } -// If all references to a DSO happen to be weak, the DSO is not added -// to DT_NEEDED. If that happens, we need to eliminate shared symbols -// created from the DSO. Otherwise, they become dangling references -// that point to a non-existent DSO. -template <class ELFT> static void demoteSharedSymbols() { - for (Symbol *Sym : Symtab->getSymbols()) - if (auto *S = dyn_cast<SharedSymbol>(Sym)) - if (!S->getFile<ELFT>().IsNeeded) - replaceSymbol<Undefined>(S, nullptr, S->getName(), STB_WEAK, S->StOther, - S->Type); -} - // Do actual linking. Note that when this function is called, // all linker scripts have already been parsed. template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { @@ -1231,7 +1219,6 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { // Do size optimizations: garbage collection, merging of SHF_MERGE sections // and identical code folding. markLive<ELFT>(); - demoteSharedSymbols<ELFT>(); decompressSections(); mergeSections(); if (Config->ICF) |