[COFF] Check for sections larger than 4 GiB
authorShoaib Meenai <smeenai@fb.com>
Tue, 19 Sep 2017 23:58:05 +0000 (23:58 +0000)
committerShoaib Meenai <smeenai@fb.com>
Tue, 19 Sep 2017 23:58:05 +0000 (23:58 +0000)
commit4aa7f8a30f1bba5dc7e6ad45ffa03325ef3fca2a
treea59d2e345a250646a85e1114cf2287a912dc3a8f
parentd3bb80a1bc6c5219a6f55b9dd625e7919b21ff82
[COFF] Check for sections larger than 4 GiB

Sections are limited to 4 GiB. Error out early if a section exceeds this
size, rather than overflowing the section size and getting confusing
assertion failures/segfaults later.

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

llvm-svn: 313699
lld/COFF/Driver.cpp
lld/COFF/Writer.cpp
lld/test/COFF/section-size.s [new file with mode: 0644]