D28107: [ELF] - Do not create huge garbage files on section offset overflow.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 01:18:05 PST 2017


>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.

George.


More information about the llvm-commits mailing list