[lld] [ELF] Align the end of PT_GNU_RELRO associated PT_LOAD to a common-page-size boundary (PR #66042)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 19:37:19 PDT 2023


MaskRay wrote:

> Thanks for updating the description, it is clearer what the problem is now.

Thanks for the suggestion!

> Is the concern about the padding section that there may be no pattern, or orphan placement might put it in the wrong place? For example in a linker script with DATA_SEGMENT_RELRO_END I could see it being worth inserting the padding section in that case as there would be a clear insertion point.
>
> I agree that most people using linker scripts are embedded users, although another use case is using ld --verbose and editing it then using it with lld. This would have DATA_SEGMENT_RELRO_END.

Yes, I wanted to avoid dealing with orphan placement. It turns out that supporting `.relro_padding` in the presence of `DATA_SEGMENT_RELRO_END` isn't too hard. I have added the support in 8790f8f34841041828202a2dc7bec66119da23d4
 
> Are there sufficient differences from GNU ld to make it worth updating the linker script differences doc https://lld.llvm.org/ELF/linker_script.html

Added some documentation.

https://github.com/llvm/llvm-project/pull/66042


More information about the llvm-commits mailing list