[ELF] - Move LinkerScript::discard to LinkerScriptBase. NFC.

Became possible after r297844

llvm-svn: 297848
This commit is contained in:
George Rimar 2017-03-15 15:42:44 +00:00
parent a5f332edd1
commit 503206c567
2 changed files with 3 additions and 4 deletions

View File

@ -288,11 +288,10 @@ void LinkerScriptBase::computeInputSections(InputSectionDescription *I) {
}
}
template <class ELFT>
void LinkerScript<ELFT>::discard(ArrayRef<InputSectionBase *> V) {
void LinkerScriptBase::discard(ArrayRef<InputSectionBase *> V) {
for (InputSectionBase *S : V) {
S->Live = false;
if (S == In<ELFT>::ShStrTab)
if (S == InX::ShStrTab)
error("discarding .shstrtab section is not allowed");
discard(S->DependentSections);
}

View File

@ -267,6 +267,7 @@ public:
uint64_t getDot() { return Dot; }
OutputSection *getOutputSection(const Twine &Loc, StringRef S);
uint64_t getOutputSectionSize(StringRef S);
void discard(ArrayRef<InputSectionBase *> V);
virtual uint64_t getSymbolValue(const Twine &Loc, StringRef S) = 0;
virtual bool isDefined(StringRef S) = 0;
@ -300,7 +301,6 @@ public:
void writeDataBytes(StringRef Name, uint8_t *Buf);
void addSymbol(SymbolAssignment *Cmd);
void discard(ArrayRef<InputSectionBase *> V);
void processCommands(OutputSectionFactory &Factory);
uint64_t getSymbolValue(const Twine &Loc, StringRef S) override;