]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Do not use memalign for TCB/TLS blocks allocation [BZ #17730]
authorFlorian Weimer <fweimer@redhat.com>
Wed, 3 Aug 2016 14:16:57 +0000 (16:16 +0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 26 Jan 2017 20:56:48 +0000 (18:56 -0200)
commitd7d49b08413124b03f227f5fe06aa811a52c2b23
tree6aec8d82136940141a3a32e3a3306efa21256af8
parentfa9a646079950ea326e1f2feee7093580dc1ecd3
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.
ChangeLog
elf/dl-tls.c
nptl/Makefile
nptl/tst-tls3-malloc.c [new file with mode: 0644]