diff options
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/dl-tls.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c index 1981d2dd98..5ec7249e34 100644 --- a/sysdeps/generic/dl-tls.c +++ b/sysdeps/generic/dl-tls.c @@ -415,7 +415,10 @@ _dl_deallocate_tls (void *tcb, bool dealloc_tcb) dtv_t *dtv = GET_DTV (tcb); /* The array starts with dtv[-1]. */ - free (dtv - 1); +#ifdef SHARED + if (dtv != GL(dl_initial_dtv)) +#endif + free (dtv - 1); if (dealloc_tcb) { |