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

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 11:47:02 PDT 2023


================
@@ -1196,9 +1202,17 @@ void LinkerScript::adjustOutputSections() {
     if (sec->sectionIndex != UINT32_MAX)
       maybePropagatePhdrs(*sec, defPhdrs);
 
+    // Discard .relro_padding if we have not seen one non-NOBITS RELRO section.
+    // Note: when .tbss is the only RELRO section, it's difficult to pick a
----------------
smithp35 wrote:

I can see that a .tbss only (which would have no impact on the PT_LOAD) would be best excluded. It looks like the code would also exclude .bss.rel.ro only. Although I'm not entirely sure if any tool actually generates those.

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


More information about the llvm-commits mailing list