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.
Details
Diff Detail
- Build Status
Buildable 10395 Build 10395: arc lint + arc unit
Event Timeline
I'm not sure how to write a test case for this without creating an object file with a section > 4 GiB (as in that object file will take upwards of 4 GiB on disk). Any ideas?
Do you mean using yaml2obj? I don't know of a way to do that via assembler directives (and I'd love to learn if there is one).
yaml2obj should allow you to create a broken object like that. IIRC there's an example in test/ELF.
I believe there's a way to create a huge .bss section using assembler, but yaml2obj is fine. We are using it for COFF tests (but not for ELF tests.)
COFF/Writer.cpp | ||
---|---|---|
191 | Can you use errro() instead? We use fatal() only for reporting corrupted input files. Files with too large sections are not technically corrupted. |
test/COFF/section-size.s | ||
---|---|---|
3–5 | Sure, will rename. | |
9 | lld-link deduplicates input object files: https://reviews.llvm.org/diffusion/L/browse/lld/trunk/COFF/Driver.cpp;313693$295-303. Is there some other way to get around that? |
test/COFF/section-size.s | ||
---|---|---|
9 | Oh, I didn't know that. cp is of course fine if that's the case. |
Can you use errro() instead? We use fatal() only for reporting corrupted input files. Files with too large sections are not technically corrupted.