[ELF] Allow references to reserved symbols in linker scripts

This requires collectign all symbols referenced in the linker script
and adding them to symbol table as undefined symbol.

Differential Revision: https://reviews.llvm.org/D31147

llvm-svn: 298577
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index 00e4f9e..6dc7051 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -217,6 +217,9 @@
 
   // A map from memory region name to a memory region descriptor.
   llvm::DenseMap<llvm::StringRef, MemoryRegion> MemoryRegions;
+
+  // A list of undefined symbols referenced by the script.
+  std::vector<llvm::StringRef> UndefinedSymbols;
 };
 
 class LinkerScript {