[PATCH] D40029: [ELF] Only add contiguous isRelro sections to PT_GNU_RELRO PHDR

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 10:28:49 PST 2017


Peter Smith <peter.smith at linaro.org> writes:

> In all cases the copy relocations are part of the PT_GNU_RELO PHDR,
> although we have used more space in the file when there is
> compiler/assembler provided .data.rel.ro in the non script case.

Yes, that is why I think we should keep the .bss.rel.ro name when we
don't have SECTIONS.

>> BTW, what is your objective in using lld with the bfd script?
>>
>
> I don't have a specific objective with the bfd linker script. I've
> sometimes wanted a linker script that gets close to ld.bfd so I can
> more easily compare the output. I've also used ld --verbose to get a
> script that I've then added a few Sections to in order to test an
> experiment. I thought I may not be the only person that occasionally
> does this.
>
> Generalising a bit, I think that it should be possible to write a
> linker script that works with both ld.bfd and lld, at least for the
> common feature set that could get used in everyday builds.
>
>> Given the above results I think that ignoring empty sections in isRelro
>> and producing an error if they are discontiguous is probably the best we can
>> do without an explicit command line option or an if on SECTIONS being present.
>>
>
> Ok, I'll take that into account and see what I can come up with. Will
> update the review tomorrow, I didn't get a chance today.

Thanks!

Rafael


More information about the llvm-commits mailing list