aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/dl-tls.c15
-rw-r--r--sysdeps/generic/ldsodefs.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c
index 7e45850..b7ed69f 100644
--- a/sysdeps/generic/dl-tls.c
+++ b/sysdeps/generic/dl-tls.c
@@ -324,6 +324,21 @@ _dl_allocate_tls (void)
return result;
}
+INTDEF(_dl_allocate_tls)
+
+
+void
+internal_function
+_dl_deallocate_tls (void *tcb)
+{
+ dtv_t *dtv = GET_DTV (tcb);
+
+ /* The array starts with dtv[-1]. */
+ free (dtv - 1);
+
+ munmap (tcb, GL(dl_tls_static_size));
+}
+
# ifdef SHARED
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index d722198..779e438 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -688,6 +688,10 @@ extern void _dl_determine_tlsoffset (void) internal_function;
/* Allocate memory for static TLS block and dtv. */
extern void *_dl_allocate_tls (void) internal_function;
+extern void *_dl_allocate_tls_internal (void) internal_function;
+
+/* Deallocate memory allocated with _dl_allocate_tls. */
+extern void _dl_deallocate_tls (void *tcb) internal_function;
/* Return the symbol address given the map of the module it is in and
the symbol record. */