glibc/sysdeps/s390/s390-64
Stefan Liebler 97b74cbbb0 s390: Simplify elf_machine_{load_address, dynamic} [BZ #31799]
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.
2024-12-13 09:44:38 +01:00
..
bits
Implies
Makefile arc4random: simplify design for better safety 2022-07-27 08:58:27 -03:00
Versions
__longjmp.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
add_n.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
bsd-_setjmp.S
bsd-setjmp.S
configure s390x: Capture grep output in static PIE check 2024-06-20 14:34:06 +02:00
configure.ac s390x: Capture grep output in static PIE check 2024-06-20 14:34:06 +02:00
crti.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
crtn.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-hwcap-check.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-hwcaps-subdirs.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-machine.h s390: Simplify elf_machine_{load_address, dynamic} [BZ #31799] 2024-12-13 09:44:38 +01:00
dl-trampoline.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-trampoline.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
s390x-mcount.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
s390x-mcount.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
setjmp.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
stackguard-macros.h
start.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
strncpy-z900.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
sub_n.S Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
sysdep.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-audit.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-glibc-hwcaps.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00