[PATCH] D24801: [ELF] - Fix combination of -script and relocatable output.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 12:51:38 PDT 2016


On 7 October 2016 at 15:49, Rui Ueyama <ruiu at google.com> wrote:
> ruiu added inline comments.
>
>
> ================
> Comment at: ELF/Writer.cpp:276-277
>      assignFileOffsets();
> +    for (OutputSectionBase<ELFT> *Sec : OutputSections)
> +      Sec->setVA(0);
>    } else {
> ----------------
> I do not understand this piece of code. VAs are initialized to zero by default, no?

Yes, I think the code is just avoiding another "if
(ScriptConfig->HasSections)", but it might be more readable with it.

Cheers,
Rafael


More information about the llvm-commits mailing list