[llvm-dev] lld error: output file too large <some large number>

Moshtaghi, Alireza via llvm-dev llvm-dev at lists.llvm.org
Sun Nov 15 00:20:29 PST 2020


Hi
I’m having a trouble linking a special program with lld and the above error is generated.
I narrowed it down to lld/Writer.cpp:getFileAlignment ().
(Well, my local repository is from a while back (version 10) and for me it is lld/Writer.cpp:computeFileOffset ())
Either way, where it is calculating the file offset when two sections share same PT_LOAD, the formula used is off2 = off1 + (VA2 – VA1) but the subtraction is causing a negative number, causing out of bound value…

Should this be abs(VA2 – VA1) ?
Or
Should it be cast to a signed integer so we subtract the difference rather than adding the large value?

Thanks
A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201115/84259659/attachment.html>


More information about the llvm-dev mailing list