[lld] r277121 - Split readOutputSectionDescription.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 28 23:14:07 PDT 2016
Author: ruiu
Date: Fri Jul 29 01:14:07 2016
New Revision: 277121
URL: http://llvm.org/viewvc/llvm-project?rev=277121&view=rev
Log:
Split readOutputSectionDescription.
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=277121&r1=277120&r2=277121&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Fri Jul 29 01:14:07 2016
@@ -443,6 +443,7 @@ private:
SymbolAssignment *readAssignment(StringRef Name);
void readOutputSectionDescription(StringRef OutSec);
+ std::vector<uint8_t> readOutputSectionFiller();
std::vector<StringRef> readOutputSectionPhdrs();
std::unique_ptr<InputSectionDescription> readInputSectionDescription();
void readInputSectionRules(InputSectionDescription *InCmd, bool Keep);
@@ -760,17 +761,20 @@ void ScriptParser::readOutputSectionDesc
}
}
Cmd->Phdrs = readOutputSectionPhdrs();
+ Cmd->Filler = readOutputSectionFiller();
+}
+std::vector<uint8_t> ScriptParser::readOutputSectionFiller() {
StringRef Tok = peek();
- if (Tok.startswith("=")) {
- if (!Tok.startswith("=0x")) {
- setError("filler should be a hexadecimal value");
- return;
- }
- Tok = Tok.substr(3);
- Cmd->Filler = parseHex(Tok);
- next();
+ if (!Tok.startswith("="))
+ return {};
+ if (!Tok.startswith("=0x")) {
+ setError("filler should be a hexadecimal value");
+ return {};
}
+ Tok = Tok.substr(3);
+ next();
+ return parseHex(Tok);
}
void ScriptParser::readProvide(bool Hidden) {
More information about the llvm-commits
mailing list