diff options
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 7da00fa4224..bbe0e45816c 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -79,6 +79,18 @@ static bool isUnderSysroot(StringRef Path) { return false; } +OutputSection *LinkerScriptBase::getOutputSection(const Twine &Loc, + StringRef Name) { + static OutputSection FakeSec("", 0, 0); + + for (OutputSection *Sec : *OutputSections) + if (Sec->Name == Name) + return Sec; + + error(Loc + ": undefined section " + Name); + return &FakeSec; +} + template <class ELFT> void LinkerScript<ELFT>::setDot(Expr E, const Twine &Loc, bool InSec) { uint64_t Val = E(); @@ -902,19 +914,6 @@ template <class ELFT> int LinkerScript<ELFT>::getSectionIndex(StringRef Name) { return INT_MAX; } -template <class ELFT> -OutputSection *LinkerScript<ELFT>::getOutputSection(const Twine &Loc, - StringRef Name) { - static OutputSection FakeSec("", 0, 0); - - for (OutputSection *Sec : *OutputSections) - if (Sec->Name == Name) - return Sec; - - error(Loc + ": undefined section " + Name); - return &FakeSec; -} - // This function is essentially the same as getOutputSection(Name)->Size, // but it won't print out an error message if a given section is not found. // |

