diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2013-12-18 16:46:18 -0800 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2013-12-18 16:46:18 -0800 |
commit | 1f33d36a8a9e78c81bed59b47f260723f56bb7e6 (patch) | |
tree | ff72018a2e0021f7a1110289681ed8ab4516df37 /sysdeps/generic | |
parent | 35e8f7ab94c910659de9d507aa0f3e1f8973d914 (diff) | |
download | glibc-1f33d36a8a9e78c81bed59b47f260723f56bb7e6.tar glibc-1f33d36a8a9e78c81bed59b47f260723f56bb7e6.tar.gz glibc-1f33d36a8a9e78c81bed59b47f260723f56bb7e6.tar.bz2 glibc-1f33d36a8a9e78c81bed59b47f260723f56bb7e6.zip |
Patch 2/4 of the effort to make TLS access async-signal-safe.
Add a signal-safe malloc replacement.
2013-12-18 Andrew Hunter <ahh@google.com>
* sysdeps/generic/ldsodefs.h (__signal_safe_memalign): New prototype.
(__signal_safe_malloc, __signal_safe_free): Likewise.
(__signal_safe_realloc, __signal_safe_calloc): Likewise.
* elf/dl-misc.c (__signal_safe_allocator_header): New struct.
(__signal_safe_memalign, __signal_safe_malloc): New function.
(__signal_safe_free, __signal_safe_realloc): Likewise.
(__signal_safe_calloc): Likewise.
* elf/dl-tls.c (allocate_dtv, _dl_clear_dtv): Call signal-safe
functions.
(_dl_deallocate_tls, _dl_update_slotinfo): Likewise.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 1bda60c6fa..48bdb6e44b 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -994,6 +994,12 @@ rtld_hidden_proto (_dl_allocate_tls_init) extern void _dl_clear_dtv (dtv_t *dtv) internal_function; rtld_hidden_proto (_dl_clear_dtv) +extern void *__signal_safe_memalign (size_t boundary, size_t size); +extern void *__signal_safe_malloc (size_t size); +extern void __signal_safe_free (void *ptr); +extern void *__signal_safe_realloc (void *ptr, size_t size); +extern void *__signal_safe_calloc (size_t nmemb, size_t size); + /* Deallocate memory allocated with _dl_allocate_tls. */ extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function; rtld_hidden_proto (_dl_deallocate_tls) |