[lld] r315432 - Do not handle DefinedCommon in linker scripts.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 10 21:31:13 PDT 2017
Author: ruiu
Date: Tue Oct 10 21:31:13 2017
New Revision: 315432
URL: http://llvm.org/viewvc/llvm-project?rev=315432&view=rev
Log:
Do not handle DefinedCommon in linker scripts.
Because of r314495, DefinedCommon symbols cannot reach to
getSymbolValue function. When they reach the fucntion, they have
already been converted to DefinedRegular symbols.
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=315432&r1=315431&r2=315432&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Oct 10 21:31:13 2017
@@ -859,12 +859,10 @@ ExprValue LinkerScript::getSymbolValue(c
error(Loc + ": unable to get location counter value");
return 0;
}
- if (SymbolBody *B = Symtab->find(S)) {
- if (auto *D = dyn_cast<DefinedRegular>(B))
- return {D->Section, false, D->Value, Loc};
- if (auto *C = dyn_cast<DefinedCommon>(B))
- return {C->Section, false, 0, Loc};
- }
+
+ if (auto *Sym = dyn_cast_or_null<DefinedRegular>(Symtab->find(S)))
+ return {Sym->Section, false, Sym->Value, Loc};
+
error(Loc + ": symbol not found: " + S);
return 0;
}
More information about the llvm-commits
mailing list