[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
Thu Nov 16 10:11:19 PST 2017


My opinions on this so far are

There should be just one PT_GNU_RELRO. We should try to get the dynamic
linkers changed only if there is a direct advantaged to having multiple
versus having the static linker putting the data in the right order.

I am OK with producing an error if a linker script would have caused
mulitple PT_GNU_RELRO to be created.

We can probably ignore empty sections when decided the PT_GNU_RELRO
start and end. This means we would have an error only when there is a ro
copy relocation.

Can we rename the section to .data.rel.ro.bss but keep the current
flags or would bfd error out with bss data not in the end of a PT_LOAD?

Cheers,
Rafael

Peter Collingbourne via Phabricator <reviews at reviews.llvm.org> writes:

> pcc added a comment.
>
> In https://reviews.llvm.org/D40029#927193, @peter.smith wrote:
>
>> Adding pcc as the original author of https://reviews.llvm.org/D28272.
>>
>> Peter, in  https://reviews.llvm.org/D28272#637284 you mention that you'd add a follow up patch that used .data.rel.ro rather than .bss.rel.ro for the copy relocations. I can't work out if that ever landed. Can you let me know if did? I've just ran into a case where the assumptions made by a ld.bfd linker script cause problems with the .bss.rel.ro name.
>
>
> No, the use of NOBITS is deliberate. See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170102/417025.html
>
> Could we instead rename .bss.rel.ro to .data.rel.ro only if the linker script has a SECTIONS clause?
>
>
> https://reviews.llvm.org/D40029


More information about the llvm-commits mailing list