]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Add test for THP alignment of large load segments
authorWANG Rui <wangrui@loongson.cn>
Mon, 20 Apr 2026 10:54:13 +0000 (10:54 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Mon, 20 Apr 2026 11:02:46 +0000 (11:02 +0000)
commitbb5c2cc2ebefc960fe389dd2e4619042e8ca6078
tree1125c3c71f1c451dc976ed8a8722f112f50843a7
parent12df33b81e6797da79836a166daab018f0de08f7
elf: Add test for THP alignment of large load segments

Add a new test to verify that large executable PT_LOAD segments are
mapped at addresses aligned to the THP size when the glibc tunable
glibc.elf.thp=1 is enabled and the system is configured to use THP
in "always" mode.

The test loads a shared object with a sufficiently large executable
segment via dlopen and inspects /proc/self/maps to check that the
mapping address is aligned to the THP page size reported by the kernel.

The test is skipped if the THP size cannot be determined or if THP is
not enabled in "always" mode.

Signed-off-by: WANG Rui <wangrui@loongson.cn>
Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/tst-thp-align.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/tst-thp-size-mod.S [new file with mode: 0644]