diff options
author | Robin Dapp <rdapp@linux.ibm.com> | 2020-04-07 21:05:38 +0200 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.ibm.com> | 2020-04-07 21:08:06 +0200 |
commit | 88e508f9f112acd07d0c49c53589160db8c85fcd (patch) | |
tree | a86b2b2c6d8467dc434f994aff6f52aa8ba4aedc /libphobos/libdruntime/gcc | |
parent | 50c7853216e8511971c55b51d7fe29173db4749b (diff) | |
download | gcc-88e508f9f112acd07d0c49c53589160db8c85fcd.zip gcc-88e508f9f112acd07d0c49c53589160db8c85fcd.tar.gz gcc-88e508f9f112acd07d0c49c53589160db8c85fcd.tar.bz2 |
S/390: Fix PR91628
With this patch we get rid of the usage of the glibc-internal symbol
__tls_get_addr_internal.
If build with multilib, the file
gcc/libphobos/libdruntime/config/systemz/get_tls_offset.S is used
for both configurations: systemz and s390.
Therefore both implementations are now in the systemz file which
uses an "#ifdef __s390x__" in order to distinguish both cases.
The s390 file is just including the systemz one.
libphobos/ChangeLog:
2020-04-07 Robin Dapp <rdapp@linux.ibm.com>
Stefan Liebler <stli@linux.ibm.com>
* configure: Regenerate.
* libdruntime/Makefile.am: Add s390x and s390.
* libdruntime/Makefile.in: Regenerate.
* libdruntime/config/s390/get_tls_offset.S: New file.
* libdruntime/config/systemz/get_tls_offset.S: New file.
* libdruntime/gcc/sections/elf_shared.d: Use ibmz_get_tls_offset.
* m4/druntime/cpu.m4: Add s390x and s390.
Diffstat (limited to 'libphobos/libdruntime/gcc')
-rw-r--r-- | libphobos/libdruntime/gcc/sections/elf_shared.d | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libphobos/libdruntime/gcc/sections/elf_shared.d b/libphobos/libdruntime/gcc/sections/elf_shared.d index b28c8dc..7ff87a8 100644 --- a/libphobos/libdruntime/gcc/sections/elf_shared.d +++ b/libphobos/libdruntime/gcc/sections/elf_shared.d @@ -1028,7 +1028,7 @@ struct tls_index } extern(C) void* __tls_get_addr(tls_index* ti) nothrow @nogc; -extern(C) void* __tls_get_addr_internal(tls_index* ti) nothrow @nogc; +extern(C) void* __ibmz_get_tls_offset(tls_index *ti) nothrow @nogc; /* The dynamic thread vector (DTV) pointers may point 0x8000 past the start of * each TLS block. This is at least true for PowerPC and Mips platforms. @@ -1086,9 +1086,11 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc auto ti = tls_index(mod, 0); version (IBMZ_Any) { - auto idx = cast(void *)__tls_get_addr_internal(&ti) - + cast(ulong)__builtin_thread_pointer(); - return idx[0 .. sz]; + // IBM Z only provides __tls_get_offset instead of __tls_get_addr + // which returns an offset relative to the thread pointer. + auto addr = __ibmz_get_tls_offset(&ti); + addr = addr + cast(c_ulong)__builtin_thread_pointer(); + return addr[0 .. sz]; } else return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz]; |