diff options
author | Florian Weimer <fweimer@redhat.com> | 2016-08-03 16:16:57 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2016-08-03 16:16:57 +0200 |
commit | 6c444ad6e953dbdf9c7be065308a0a7779d32bb2 (patch) | |
tree | 3fb6aaaf2ac1d840ec6cebd39944d17f54b78b95 /ChangeLog | |
parent | a2ff21f825adb8821eeb6145197fa8b9a8a60a58 (diff) | |
download | glibc-6c444ad6e953dbdf9c7be065308a0a7779d32bb2.tar glibc-6c444ad6e953dbdf9c7be065308a0a7779d32bb2.tar.gz glibc-6c444ad6e953dbdf9c7be065308a0a7779d32bb2.tar.bz2 glibc-6c444ad6e953dbdf9c7be065308a0a7779d32bb2.zip |
elf: Do not use memalign for TCB/TLS blocks allocation [BZ #17730]
Instead, call malloc and explicitly align the pointer.
There is no external location to store the original (unaligned)
pointer, and this commit increases the allocation size to store
the pointer at a fixed location relative to the TCB pointer.
The manual alignment means that some space goes unused which
was previously made available for subsequent allocations.
However, in the TLS_DTV_AT_TP case, the manual alignment code
avoids aligning the pre-TCB to the TLS block alignment. (Even
while using memalign, the allocation had some unused padding
in front.)
This concludes the removal of memalign calls from the TLS code,
and the new tst-tls3-malloc test verifies that only core malloc
routines are used.
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1,6 +1,21 @@ 2016-08-03 Florian Weimer <fweimer@redhat.com> [BZ #17730] + Avoid using memalign for TCB allocations. + * elf/dl-tls.c (tcb_to_pointer_to_free_location): New. + (_dl_allocate_tls_storage): Use malloc and manual alignment. + Avoid alignment gap in the TLS_DTV_AT_TP case. + (_dl_deallocate_tls): Use tcb_to_pointer_to_free_location to + determine the pointer to free. + * nptl/tst-tls3-malloc.c: New test. + * nptl/Makefile (tests): Add it. + (tst-tls3-malloc): Link with libdl, libpthread. + (LDFLAGS-tst-tls3-malloc): Set. + (tst-tls3-malloc.out): Depend on DSO used in test. + +2016-08-03 Florian Weimer <fweimer@redhat.com> + + [BZ #17730] Avoid using memalign for TLS allocations. * sysdeps/generic/dl-dtv.h (struct dtv_pointer): New. Replaces is_static member with to_free member. |