[PATCH v3] elf: Set p_align to the minimum page size if possible

Jan Beulich jbeulich@suse.com
Fri Jan 14 08:27:35 GMT 2022


On 29.12.2021 20:39, H.J. Lu via Binutils wrote:
> --- a/ld/testsuite/ld-elf/linux-x86.exp
> +++ b/ld/testsuite/ld-elf/linux-x86.exp
> @@ -185,6 +185,42 @@ run_ld_link_exec_tests [list \
>  	"" \
>  	"tmpdir/indirect-extern-access-2.so" \
>      ] \
> +    [list \
> +	"Run p_align-1a without PIE" \
> +	"$NOPIE_LDFLAGS" \
> +	"" \
> +	{ p_align-1.c } \
> +	"p_align-1a" \
> +	"pass.out" \
> +	"$NOPIE_CFLAGS" \
> +    ] \
> +    [list \
> +	"Run p_align-1b with PIE" \
> +	"-pie" \
> +	"" \
> +	{ p_align-1.c } \
> +	"p_align-1b" \
> +	"pass.out" \
> +	"-fpie" \
> +    ] \
> +    [list \
> +	"Run p_align-1c with -Wl,-z,max-page-size=0x1000 without PIE" \
> +	"$NOPIE_LDFLAGS -Wl,-z,max-page-size=0x1000" \
> +	"" \
> +	{ p_align-1.c } \
> +	"p_align-1c" \
> +	"pass.out" \
> +	"$NOPIE_CFLAGS" \
> +    ] \
> +    [list \
> +	"Run p_align-1d with -Wl,-z,max-page-size=0x1000 with PIE" \
> +	"-pie -Wl,-z,max-page-size=0x1000" \
> +	"" \
> +	{ p_align-1.c } \
> +	"p_align-1d" \
> +	"pass.out" \
> +	"-fpie" \
> +    ] \
>  ]

The two PIE variants of this also fail for me on glibc 2.26. Looks
like LOAD segments' alignment isn't being honored there, at least
not if it's as big as it is here.

Jan



More information about the Binutils mailing list