From fc16173cebfb61c13319d6ebada3bb2c4fad14e7 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 21 Mar 2017 21:49:16 +0000 Subject: [PATCH] Sort. NFC. llvm-svn: 298447 --- lld/ELF/LinkerScript.cpp | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index b80b81356210..304b3dbd05f6 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -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,22 +1807,16 @@ Expr ScriptParser::readPrimary() { 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 @@ 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,14 +1842,26 @@ Expr ScriptParser::readPrimary() { 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(); };