D28107: [ELF] - Do not create huge garbage files on section offset overflow.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 17 05:31:05 PST 2017
George Rimar <grimar at accesssoftek.com> writes:
>>ruiu added a comment.
>>
>>I think I suggested this before, but I'd suggest using uint64_t instead of uintX_t to keep a file size. On 32-bit, if a file size is >4GB, you want to report an error.
>
> I think that orthogonal to what this patch do and does not help in next case:
>
> . = 0x0;
> . -= 1;
> . += 1;
>
> After line 3 we know there was a error after moving location counter backward. But size of file should be fine (less than 4gb).
> LLD will try to open file and mapping to create output, even knowing that we already have a error.
> That is not clean behavior.
>
> And for x64 case behavior is the same, and ">4GB" check is not applicable here.
I agree. This is just an early exit if we know something is already
broken.
LGTM with a comment.
Cheers,
Rafael
More information about the llvm-commits
mailing list