[lld] r298447 - Sort. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 21 14:49:16 PDT 2017
Author: ruiu
Date: Tue Mar 21 16:49:16 2017
New Revision: 298447
URL: http://llvm.org/viewvc/llvm-project?rev=298447&view=rev
Log:
Sort. NFC.
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=298447&r1=298446&r2=298447&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Mar 21 16:49:16 2017
@@ -1796,12 +1796,6 @@ Expr ScriptParser::readPrimary() {
return {Script->getOutputSection(Location, Name), 0};
};
}
- if (Tok == "LOADADDR") {
- StringRef Name = readParenLiteral();
- return [=] { return Script->getOutputSection(Location, Name)->getLMA(); };
- }
- if (Tok == "ASSERT")
- return readAssert();
if (Tok == "ALIGN") {
expect("(");
Expr E = readExpr();
@@ -1813,21 +1807,15 @@ Expr ScriptParser::readPrimary() {
expect(")");
return [=] { return alignTo(Script->getDot(), E().getValue()); };
}
- if (Tok == "CONSTANT") {
+ if (Tok == "ALIGNOF") {
StringRef Name = readParenLiteral();
- return [=] { return getConstant(Name); };
+ return [=] { return Script->getOutputSection(Location, Name)->Alignment; };
}
- if (Tok == "DEFINED") {
+ if (Tok == "ASSERT")
+ return readAssert();
+ if (Tok == "CONSTANT") {
StringRef Name = readParenLiteral();
- return [=] { return Script->isDefined(Name) ? 1 : 0; };
- }
- if (Tok == "SEGMENT_START") {
- expect("(");
- skip();
- expect(",");
- Expr E = readExpr();
- expect(")");
- return [=] { return E(); };
+ return [=] { return getConstant(Name); };
}
if (Tok == "DATA_SEGMENT_ALIGN") {
expect("(");
@@ -1843,10 +1831,10 @@ Expr ScriptParser::readPrimary() {
expect(")");
return [] { return Script->getDot(); };
}
- // GNU linkers implements more complicated logic to handle
- // DATA_SEGMENT_RELRO_END. We instead ignore the arguments and just align to
- // the next page boundary for simplicity.
if (Tok == "DATA_SEGMENT_RELRO_END") {
+ // GNU linkers implements more complicated logic to handle
+ // DATA_SEGMENT_RELRO_END. We instead ignore the arguments and
+ // just align to the next page boundary for simplicity.
expect("(");
readExpr();
expect(",");
@@ -1854,13 +1842,25 @@ Expr ScriptParser::readPrimary() {
expect(")");
return [] { return alignTo(Script->getDot(), Target->PageSize); };
}
- if (Tok == "SIZEOF") {
+ if (Tok == "DEFINED") {
StringRef Name = readParenLiteral();
- return [=] { return Script->getOutputSectionSize(Name); };
+ return [=] { return Script->isDefined(Name) ? 1 : 0; };
}
- if (Tok == "ALIGNOF") {
+ if (Tok == "LOADADDR") {
StringRef Name = readParenLiteral();
- return [=] { return Script->getOutputSection(Location, Name)->Alignment; };
+ return [=] { return Script->getOutputSection(Location, Name)->getLMA(); };
+ }
+ if (Tok == "SEGMENT_START") {
+ expect("(");
+ skip();
+ expect(",");
+ Expr E = readExpr();
+ expect(")");
+ return [=] { return E(); };
+ }
+ if (Tok == "SIZEOF") {
+ StringRef Name = readParenLiteral();
+ return [=] { return Script->getOutputSectionSize(Name); };
}
if (Tok == "SIZEOF_HEADERS")
return [=] { return elf::getHeaderSize(); };
More information about the llvm-commits
mailing list