[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/30373] Random? failure of "p_align-1b with PIE" and "p_align-1d
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/30373] Random? failure of "p_align-1b with PIE" and "p_align-1d with -Wl,-z,max-page-size=0x1000 with PIE" |
Date: |
Thu, 20 Apr 2023 16:37:07 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=30373
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
FYI
commit 74e315dbfe5200c473b226e937935fb8ce391489
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Dec 13 19:46:04 2021 -0800
elf: Set p_align to the minimum page size if possible
Currently, on 32-bit and 64-bit ARM, it seems that ld generates p_align
values of 0x10000 even if no section alignment is greater than 0x1000.
The issue is more general and probably affects other targets with multiple
page sizes.
While file layout absolutely must take 64K page size into account, that
does not have to be reflected in the p_align value. If running on a 64K
kernel, the file will be loaded at a 64K page boundary by necessity. On
a 4K kernel, 64K alignment is not needed.
The glibc loader has been fixed to honor p_align:
https://sourceware.org/bugzilla/show_bug.cgi?id=28676
similar to kernel:
commit ce81bb256a224259ab686742a6284930cbe4f1fa
Author: Chris Kennelly <ckennelly@google.com>
Date: Thu Oct 15 20:12:32 2020 -0700
fs/binfmt_elf: use PT_LOAD p_align values for suitable start address
This means that on 4K kernels, we will start to do extra work for 64K
p_align, but this pointless for pretty much all binaries (whose section
alignment rarely exceeds 16).
The minimum page size is used, instead of the maximum section alignment
due to this glibc bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=28688
It has been fixed in glibc 2.35.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/30373] New: Random? failure of "p_align-1b with PIE" and "p_align-1d with -Wl,-z,max-page-size=0x1000 with PIE", clyon at gcc dot gnu.org, 2023/04/20
- [Bug ld/30373] Random? failure of "p_align-1b with PIE" and "p_align-1d with -Wl,-z,max-page-size=0x1000 with PIE", hjl.tools at gmail dot com, 2023/04/20
- [Bug ld/30373] Random? failure of "p_align-1b with PIE" and "p_align-1d with -Wl,-z,max-page-size=0x1000 with PIE",
hjl.tools at gmail dot com <=
- [Bug ld/30373] Random? failure of "p_align-1b with PIE" and "p_align-1d with -Wl,-z,max-page-size=0x1000 with PIE", clyon at gcc dot gnu.org, 2023/04/21
- [Bug ld/30373] Random? failure of "p_align-1b with PIE" and "p_align-1d with -Wl,-z,max-page-size=0x1000 with PIE", clyon at gcc dot gnu.org, 2023/04/21