[PATCH v7] elf: Handle static PIE with non-zero load address [BZ #31799]

Florian Weimer fweimer@redhat.com
Fri Nov 29 16:52:51 GMT 2024


* H. J. Lu:

> +ifneq (,$(load-address-ldflag))
> +tests += \
> +  tst-pie-address \
> +  # tests
> +tests-pie += \
> +  tst-pie-address \
> +  # tests-pie
> +LDFLAGS-tst-pie-address += $(load-address-ldflag)=$(pde-load-address)
> +ifeq (yes,$(enable-static-pie))
> +tests += \
> +  tst-pie-address-static \
> +  # tests
> +tests-static += \
> +  tst-pie-address-static \
> +  # tests-static
> +LDFLAGS-tst-pie-address-static += \
> +  $(load-address-ldflag)=$(pde-load-address)
> +endif
> +endif

These tests fail on aarch64 and s390x for us:

=====FAIL: elf/tst-pie-address.out=====
=====FAIL: elf/tst-pie-address.test-result=====
FAIL: elf/tst-pie-address
original exit status 139
=====FAIL: elf/tst-pie-address-static.out=====
=====FAIL: elf/tst-pie-address-static.test-result=====
FAIL: elf/tst-pie-address-static
original exit status 132

The configure checks report this 

checking whether -fPIE is default... no
checking PDE load address... 0x0000000001000000
checking for linker that supports -Ttext-segment=0x0000000001000000... yes
checking if we can build programs as PIE... yes
checking if we can build static PIE programs... yes

checking whether -fPIE is default... no
checking PDE load address... 0x0000000000400000
checking for linker that supports -Ttext-segment=0x0000000000400000... yes
checking if we can build programs as PIE... yes
checking if we can build static PIE programs... yes

Thanks,
Florian



More information about the Libc-alpha mailing list