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

Fāng-ruì Sòng via llvm-dev llvm-dev at lists.llvm.org
Sun Nov 15 23:19:21 PST 2020


Hi Alireza, getFileAlignment was renamed in Oct 2018. It seems that
you may have sectionA and sectionB in one PT_LOAD while sectionB has a
lower address. This is invalid.

Can you provide more information about how you have a sectionB with a
lower address? Note that LLD has an error "unable to move location
counter backward for: ".

On Sun, Nov 15, 2020 at 12:20 AM Moshtaghi, Alireza via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> 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.
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



-- 
宋方睿


More information about the llvm-dev mailing list