From ab0cce5f1f0aac2699b9efb4c6d8021497439e9d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 26 Apr 2018 17:58:58 +0000 Subject: Replace SharedSymbols with Defined when creating copy relocations. This is slightly simpler to read IMHO. Now if a symbol has a position in the file, it is Defined. The main motivation is that with this a SharedSymbol doesn't need a section, which reduces the size of SymbolUnion. With this the peak allocation when linking chromium goes from 568.1 to 564.2 MB. llvm-svn: 330966 --- lld/ELF/LinkerScript.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lld/ELF/LinkerScript.cpp') diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index d99d38272df..1c71c528830 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -1111,8 +1111,8 @@ ExprValue LinkerScript::getSymbolValue(StringRef Name, const Twine &Loc) { if (auto *DS = dyn_cast(Sym)) return {DS->Section, false, DS->Value, Loc}; if (auto *SS = dyn_cast(Sym)) - if (!ErrorOnMissingSection || SS->CopyRelSec) - return {SS->CopyRelSec, false, 0, Loc}; + if (!ErrorOnMissingSection) + return {nullptr, false, 0, Loc}; } error(Loc + ": symbol not found: " + Name); -- cgit v1.2.3