Revert "[ELF] SHF_MERGE section with 0 entsize is not fatal"

This reverts commit r263664.

The reason we were getting broken files was lld -r, and that has been
fixed.

llvm-svn: 263944
This commit is contained in:
Rafael Espindola
2016-03-21 14:57:20 +00:00
parent 9c8ff3551a
commit 0d2ad420df
4 changed files with 5 additions and 7 deletions

View File

@@ -148,9 +148,7 @@ template <class ELFT> static bool shouldMerge(const typename ELFT::Shdr &Sec) {
if (Flags & SHF_WRITE)
fatal("writable SHF_MERGE sections are not supported");
uintX_t EntSize = Sec.sh_entsize;
if (!EntSize)
return false;
if (Sec.sh_size % EntSize)
if (!EntSize || Sec.sh_size % EntSize)
fatal("SHF_MERGE section size must be a multiple of sh_entsize");
// Don't try to merge if the aligment is larger than the sh_entsize and this