[PATCH] D28761: [ELF] Bypass section type check.

Evgeny Leviant via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 03:15:28 PST 2017


Added and committed in r293276

________________________________________
От: Rafael Avila de Espindola <rafael.espindola at gmail.com>
Отправлено: 27 января 2017 г. 0:15
Кому: Evgeny Leviant; reviews+D28761+public+c00796a0207ed902 at reviews.llvm.org; ruiu at google.com
Копия: llvm-commits at lists.llvm.org; ikudrin.dev at gmail.com; George Rimar; adhemerval.zanella at linaro.org
Тема: RE: [PATCH] D28761: [ELF] Bypass section type check.

Evgeny Leviant <eleviant at accesssoftek.com> writes:

> I didn't get your previous response, so I guess something went wrong with phab.
>
> Regarding your question: I have kernel build script which generates 3 main sections (RX, RO, RW),
> grouping all sections with corresponding access permissions and assigns specific LMA to RX, RW and RO correspondingly.
> Both ld and gold process this script correctly out of the box.
>
> My understanding is that even though init_array (and friends) has special type it's still an RW section,
> so I think I should still be able to join it with other RW sections in linker script.
>
> So is it okay to commit this patch as is?

Please add a case similar to how we handle nobits/progbits with a comment. We
should avoid having different behavior with or without linker scripts.

The existing code I am referring to is:

    // Convert notbits to progbits if they are mixed. This happens is some
    // linker scripts.
    if (Sec->Type == SHT_NOBITS && C->Type == SHT_PROGBITS)
      Sec->Type = SHT_PROGBITS;

Cheers,
Rafael


More information about the llvm-commits mailing list