[PATCH] D56828: [ELF] Make RW PT_LOAD start with PT_GNU_RELRO sections
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 16:36:04 PST 2019
ruiu added a comment.
Thank you for your explanation. I think that makes sense.
================
Comment at: ELF/Writer.cpp:824-826
+ // Place writable non-RELRO sections first so that the PT_LOAD starts with
+ // PT_GNU_RELRO sections, which ensures the PT_LOAD splits into at most 2
+ // maps at runtime.
----------------
I don't feel this comment explains the intention of the change clearly. IIUC, the intention of the change is to separate relro sections (e.g. .data.rel.ro and .bss.rel.ro) from non-relro sections (e.g. .data and .bss), so that we don't waste space for page alignment. An alternative ordering, e.g., .data, .data.rel.ro, .bss, .bss.rel.ro, wastes on average address space of 2 pages because each section would be page-aligned.
Repository:
rLLD LLVM Linker
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56828/new/
https://reviews.llvm.org/D56828
More information about the llvm-commits
mailing list