[PATCH] D24795: [ELF] Linkerscript: Try to put section to the last PT_LOAD, in case there is no exact segment specification

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 07:39:01 PDT 2016

> ================
> Comment at: ELF/LinkerScript.cpp:713
> +
>      if (!PhdrIds.empty()) {
>        // Assign headers specified by linker script
> ----------------
> rafael wrote:
>> This if is not necessary anymore, no?
> Not exactly. You may have no PT_LOAD segments in PHDRS directive. GNU gold (bunutils 2.26) crashes in such case. I think we shouldn't

But the if has no else and the body is just a loop that will run 0
times is the vector is empty.


More information about the llvm-commits mailing list