Allow SIZEOF() command on nonexistent section.

Linker script doesn't create a section if it has no content. So the following
script doesn't create .norelocs section if it doesn't have any .rel* sections.

  .norelocs : { *(.rel*) }

Later, if you assert that the size of .norelocs is 0, LLD printed out
an error message, because it didn't allow calling SIZEOF() on nonexistent
sections.

This patch allows SIZEOF() on nonexistent sections, so that you can do
something like this.

  ASSERT(SIZEOF(.norelocs), "shouldn't contain .rel sections!")

Note that this behavior is compatible with GNU.

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

llvm-svn: 287257
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index 0f10d6b..e679355 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -195,6 +195,7 @@
   virtual bool isAbsolute(StringRef S) = 0;
   virtual const OutputSectionBase *getSymbolSection(StringRef S) = 0;
   virtual const OutputSectionBase *getOutputSection(StringRef S) = 0;
+  virtual uint64_t getOutputSectionSize(StringRef S) = 0;
 };
 
 // ScriptConfiguration holds linker script parse results.
@@ -245,6 +246,7 @@
   bool isAbsolute(StringRef S) override;
   const OutputSectionBase *getSymbolSection(StringRef S) override;
   const OutputSectionBase *getOutputSection(StringRef S) override;
+  uint64_t getOutputSectionSize(StringRef S) override;
 
   std::vector<OutputSectionBase *> *OutputSections;