mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
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
This commit is contained in:
@@ -1111,8 +1111,8 @@ ExprValue LinkerScript::getSymbolValue(StringRef Name, const Twine &Loc) {
|
||||
if (auto *DS = dyn_cast<Defined>(Sym))
|
||||
return {DS->Section, false, DS->Value, Loc};
|
||||
if (auto *SS = dyn_cast<SharedSymbol>(Sym))
|
||||
if (!ErrorOnMissingSection || SS->CopyRelSec)
|
||||
return {SS->CopyRelSec, false, 0, Loc};
|
||||
if (!ErrorOnMissingSection)
|
||||
return {nullptr, false, 0, Loc};
|
||||
}
|
||||
|
||||
error(Loc + ": symbol not found: " + Name);
|
||||
|
||||
Reference in New Issue
Block a user