summaryrefslogtreecommitdiff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-04-24 08:00:37 +0000
committerJakub Jelinek <jakub@redhat.com>2009-04-24 08:00:37 +0000
commit7dec33c08e4755e72d1280e48e61f0141dfc1da5 (patch)
tree22aa7aa8ebc1f795e180c8c0d99cdda7d2a3ffef /elf/dl-open.c
parent335206256c84eaefab082284523e5b8f89fcffb2 (diff)
Updated to fedora-glibc-20090424T0747cvs/fedora-glibc-2_9_90-20
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 458cf0cd13..c3f0e42d5e 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -490,6 +490,18 @@ dl_open_worker (void *a)
if (imap->l_need_tls_init)
{
+ /* For static TLS we have to allocate the memory here
+ and now. This includes allocating memory in the DTV.
+ But we cannot change any DTV other than our own. So,
+ if we cannot guarantee that there is room in the DTV
+ we don't even try it and fail the load.
+
+ XXX We could track the minimum DTV slots allocated in
+ all threads. */
+ if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
+ _dl_signal_error (0, "dlopen", NULL, N_("\
+cannot load any more object with static TLS"));
+
imap->l_need_tls_init = 0;
#ifdef SHARED
/* Update the slot information data for at least the