diff options
author | Florian Weimer <fweimer@redhat.com> | 2025-01-02 13:45:27 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2025-01-02 13:45:27 +0100 |
commit | 30e32da6aafcef5a5d5a1c91e233636db6493fc8 (patch) | |
tree | 75e37effdbf22fe447ee9453f04c6d5f0da8df86 /sysdeps/unix/sysv/linux/gethostid.c | |
parent | 91ee75abcf3f92f63c59fb92a5c5d33bd8988362 (diff) | |
download | glibc-30e32da6aafcef5a5d5a1c91e233636db6493fc8.zip glibc-30e32da6aafcef5a5d5a1c91e233636db6493fc8.tar.gz glibc-30e32da6aafcef5a5d5a1c91e233636db6493fc8.tar.bz2 |
elf: Use TLS_DTV_OFFSET in __tls_get_addr
This fixes commit 5e249192cac7354af02a7347a0d8c984e0c88ed3 ("elf:
Remove the GET_ADDR_ARGS and related macros from the TLS code"):
GET_ADDR_ARGS was indeed unused, but GET_ADDR_OFFSET was used
on several targets, those that define TLS_DTV_OFFSET. Instead
of reintroducing GET_ADDR_OFFSET, use TLS_DTV_OFFSET directly,
now that it is defined on all targets.
In the new tls_get_addr_adjust helper function, add a cast to
uintptr_t to help the s390 case, where the offset can be positive or
negative, depending on the addresses malloc returns. The cast avoids
pointer wraparound/overflow. The outer uintptr_t cast is needed
to suppress a warning on x86-64 x32 about mismatched integer/pointer
sizes.
Eventually this offset should be folded into the DTV addresses
themselves, to eliminate the subtraction on the TLS fast path.
This will require an adjustment to libthread_db because the
debugger interface currently returns unadjusted pointers.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/gethostid.c')
0 files changed, 0 insertions, 0 deletions