aboutsummaryrefslogtreecommitdiff
path: root/nptl/Makefile
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-08-03 16:16:57 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-08-03 16:16:57 +0200
commit6c444ad6e953dbdf9c7be065308a0a7779d32bb2 (patch)
tree3fb6aaaf2ac1d840ec6cebd39944d17f54b78b95 /nptl/Makefile
parenta2ff21f825adb8821eeb6145197fa8b9a8a60a58 (diff)
downloadglibc-6c444ad6e953dbdf9c7be065308a0a7779d32bb2.zip
glibc-6c444ad6e953dbdf9c7be065308a0a7779d32bb2.tar.gz
glibc-6c444ad6e953dbdf9c7be065308a0a7779d32bb2.tar.bz2
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 'nptl/Makefile')
-rw-r--r--nptl/Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 0d8aade..2ddcd2b 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -321,8 +321,8 @@ tests += tst-cancelx2 tst-cancelx3 tst-cancelx4 tst-cancelx5 \
tst-cleanupx0 tst-cleanupx1 tst-cleanupx2 tst-cleanupx3 tst-cleanupx4 \
tst-oncex3 tst-oncex4
ifeq ($(build-shared),yes)
-tests += tst-atfork2 tst-tls3 tst-tls4 tst-tls5 tst-_res1 tst-fini1 \
- tst-stackguard1
+tests += tst-atfork2 tst-tls3 tst-tls3-malloc tst-tls4 tst-tls5 tst-_res1 \
+ tst-fini1 tst-stackguard1
tests-nolibpthread += tst-fini1
ifeq ($(have-z-execstack),yes)
tests += tst-execstack
@@ -529,6 +529,10 @@ LDFLAGS-tst-tls3 = -rdynamic
$(objpfx)tst-tls3.out: $(objpfx)tst-tls3mod.so
$(objpfx)tst-tls3mod.so: $(shared-thread-library)
+$(objpfx)tst-tls3-malloc: $(libdl) $(shared-thread-library)
+LDFLAGS-tst-tls3-malloc = -rdynamic
+$(objpfx)tst-tls3-malloc.out: $(objpfx)tst-tls3mod.so
+
$(objpfx)tst-tls4: $(libdl) $(shared-thread-library)
$(objpfx)tst-tls4.out: $(objpfx)tst-tls4moda.so $(objpfx)tst-tls4modb.so