[ELF] - Linkerscript: implemented output section [address] attribute.

Output section description in SECTIONS looks like that:

section [address] [(type)] :
...
{
...
}

Patch implements support of address atribute.

Differential revision: https://reviews.llvm.org/D22689

llvm-svn: 276619
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index efb3c4a..403bff9 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -194,6 +194,9 @@
       if (Sec->getName() != Cmd->Name)
         continue;
 
+      if (Cmd->AddrExpr)
+        Dot = Cmd->AddrExpr(Dot);
+
       if ((Sec->getFlags() & SHF_TLS) && Sec->getType() == SHT_NOBITS) {
         uintX_t TVA = Dot + ThreadBssOffset;
         TVA = alignTo(TVA, Sec->getAlignment());
@@ -648,6 +651,12 @@
 void ScriptParser::readOutputSectionDescription(StringRef OutSec) {
   OutputSectionCommand *Cmd = new OutputSectionCommand(OutSec);
   Opt.Commands.emplace_back(Cmd);
+
+  // Read an address expression.
+  // https://sourceware.org/binutils/docs/ld/Output-Section-Address.html#Output-Section-Address
+  if (peek() != ":")
+    Cmd->AddrExpr = readExpr();
+
   expect(":");
 
   // Parse constraints.