[PATCH] D125410: [ELF] Align the end of PT_GNU_RELRO to max-page-size instead of common-page-size

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 11:44:00 PDT 2023


MaskRay added a comment.

This is superseded by https://github.com/llvm/llvm-project/pull/66042 . I've mentioned there why `runtime_page_size < common-page-size` may lead to glibc rtld `error while loading shared libraries: cannot apply additional memory protection after relocation: Cannot allocate memory`.
If we simply change common-page-size to max-page-size on the `p->p_memsz` line, this condition would be `runtime_page_size < max-page-size` .
When max-page-size is 64KiB (ARM/AArch64/PowerPC) and runtime page-size is typically smaller (4KiB), `error while loading shared libraries: cannot apply additional memory protection after relocation: Cannot allocate memory` will almost assuredly occur.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125410/new/

https://reviews.llvm.org/D125410



More information about the llvm-commits mailing list