Sort. NFC.
llvm-svn: 298447
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index b80b813..304b3db 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -1796,12 +1796,6 @@
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,22 +1807,16 @@
expect(")");
return [=] { return alignTo(Script->getDot(), E().getValue()); };
}
+ if (Tok == "ALIGNOF") {
+ StringRef Name = readParenLiteral();
+ return [=] { return Script->getOutputSection(Location, Name)->Alignment; };
+ }
+ if (Tok == "ASSERT")
+ return readAssert();
if (Tok == "CONSTANT") {
StringRef Name = readParenLiteral();
return [=] { return getConstant(Name); };
}
- if (Tok == "DEFINED") {
- StringRef Name = readParenLiteral();
- return [=] { return Script->isDefined(Name) ? 1 : 0; };
- }
- if (Tok == "SEGMENT_START") {
- expect("(");
- skip();
- expect(",");
- Expr E = readExpr();
- expect(")");
- return [=] { return E(); };
- }
if (Tok == "DATA_SEGMENT_ALIGN") {
expect("(");
Expr E = readExpr();
@@ -1843,10 +1831,10 @@
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,14 +1842,26 @@
expect(")");
return [] { return alignTo(Script->getDot(), Target->PageSize); };
}
+ if (Tok == "DEFINED") {
+ StringRef Name = readParenLiteral();
+ return [=] { return Script->isDefined(Name) ? 1 : 0; };
+ }
+ if (Tok == "LOADADDR") {
+ StringRef Name = readParenLiteral();
+ 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 == "ALIGNOF") {
- StringRef Name = readParenLiteral();
- return [=] { return Script->getOutputSection(Location, Name)->Alignment; };
- }
if (Tok == "SIZEOF_HEADERS")
return [=] { return elf::getHeaderSize(); };