[PATCH] s390: Simplify elf_machine_{load_address,dynamic} [BZ #31799]

Stefan Liebler stli@linux.ibm.com
Fri Dec 13 08:46:08 GMT 2024


On 06.12.24 12:50, Stefan Liebler wrote:
> If an executable is static PIE and has a non-zero load address
> (compare to elf/tst-pie-address-static), it segfaults as
> elf_machine_load_address() returns 0x0 and elf_machine_dynamic()
> returns the run-time instead of link-time address of _DYNAMIC.
> 
> Now rely on __ehdr_start and _DYNAMIC as also done on other
> architectures.
> 
> Checked back to old arch-levels that this approach works fine:
> - 31bit: -march=g5
> - 64bit: -march=z900
> 
> Note, that there is no static-PIE support on 31bit, but this
> approach cleans it also up.
> 
> Furthermore this cleanup in glibc does not change anything
> regarding the first GOT-element as the s390 ABI
> (https://github.com/IBM/s390x-abi) explicitely defines:
> The doubleword at _GLOBAL_OFFSET_TABLE_[0] is set by the linkage
> editor to hold the address of the dynamic structure, referenced
> with the symbol _DYNAMIC. This allows a program, such as the dynamic
> linker, to find its own dynamic structure without having yet processed
> its relocation entries. This is especially important for the dynamic
> linker, because it must initialize itself without relying on other
> programs to relocate its memory image.
> ---

FYI: I've just committed this patch


More information about the Libc-alpha mailing list