Split readOutputSectionDescription.

llvm-svn: 277121
This commit is contained in:
Rui Ueyama 2016-07-29 06:14:07 +00:00
parent e4f868ea16
commit f71caa2b49
1 changed files with 12 additions and 8 deletions

View File

@ -443,6 +443,7 @@ private:
SymbolAssignment *readAssignment(StringRef Name); SymbolAssignment *readAssignment(StringRef Name);
void readOutputSectionDescription(StringRef OutSec); void readOutputSectionDescription(StringRef OutSec);
std::vector<uint8_t> readOutputSectionFiller();
std::vector<StringRef> readOutputSectionPhdrs(); std::vector<StringRef> readOutputSectionPhdrs();
std::unique_ptr<InputSectionDescription> readInputSectionDescription(); std::unique_ptr<InputSectionDescription> readInputSectionDescription();
void readInputSectionRules(InputSectionDescription *InCmd, bool Keep); void readInputSectionRules(InputSectionDescription *InCmd, bool Keep);
@ -760,17 +761,20 @@ void ScriptParser::readOutputSectionDescription(StringRef OutSec) {
} }
} }
Cmd->Phdrs = readOutputSectionPhdrs(); Cmd->Phdrs = readOutputSectionPhdrs();
Cmd->Filler = readOutputSectionFiller();
}
std::vector<uint8_t> ScriptParser::readOutputSectionFiller() {
StringRef Tok = peek(); StringRef Tok = peek();
if (Tok.startswith("=")) { if (!Tok.startswith("="))
if (!Tok.startswith("=0x")) { return {};
setError("filler should be a hexadecimal value"); if (!Tok.startswith("=0x")) {
return; setError("filler should be a hexadecimal value");
} return {};
Tok = Tok.substr(3);
Cmd->Filler = parseHex(Tok);
next();
} }
Tok = Tok.substr(3);
next();
return parseHex(Tok);
} }
void ScriptParser::readProvide(bool Hidden) { void ScriptParser::readProvide(bool Hidden) {