Make dummy variable's scope smaller.
llvm-svn: 299492
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 73d4dea..4eca9dd 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -136,15 +136,14 @@
OutputSection *LinkerScript::getOutputSection(const Twine &Loc,
StringRef Name) {
- static OutputSection FakeSec("", 0, 0);
-
for (OutputSection *Sec : *OutputSections)
if (Sec->Name == Name)
return Sec;
+ static OutputSection Dummy("", 0, 0);
if (ErrorOnMissingSection)
error(Loc + ": undefined section " + Name);
- return &FakeSec;
+ return &Dummy;
}
// This function is essentially the same as getOutputSection(Name)->Size,