Recommit r283733 "[ELF] - Do not crash if common symbol alignment set to value greater than UINT32_MAX.

With fix: commit changes from InputFiles.cpp too.

Original commit message:
We have following code in lld, that truncates the alignment value to 32 bit. Big alignment in this case
may give result 0 and crash later.

template <class ELFT>
CommonInputSection<ELFT>::CommonInputSection(std::vector<DefinedCommon *> Syms)
    : InputSection<ELFT>(nullptr, &Hdr, "") {
....
  for (DefinedCommon *Sym : Syms) {
    this->Alignment = std::max<uintX_t>(this->Alignment, Sym->Alignment);
...
  }
}

Patch fixes the issue.

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

llvm-svn: 283738
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index cc8a849..e3266f1 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -437,9 +437,9 @@
                                               /*CanOmitFromDynSym*/ false, this)
         ->body();
   case SHN_COMMON:
-    if (Sym->st_value == 0)
+    if (Sym->st_value == 0 || Sym->st_value >= UINT32_MAX)
       fatal(getFilename(this) + ": common symbol '" + Name +
-            "' alignment is 0");
+            "' has invalid alignment: " + Twine(Sym->st_value));
     return elf::Symtab<ELFT>::X->addCommon(Name, Sym->st_size, Sym->st_value,
                                            Binding, Sym->st_other,
                                            Sym->getType(), this)