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>