This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Async signal safe TLS accesses

On Tue, Nov 5, 2013 at 2:34 PM, Joseph S. Myers <> wrote:
> On Tue, 5 Nov 2013, Paul Pluzhnikov wrote:

>> Would it be ok to put a "stub" _dl_mask_all_signals() into
>> sysdeps/mach/hurd/dl-sysdep.c, and provide real implementation in
>> sysdeps/unix/sysv/linux/dl-sysdep.c ?
> Yes.  As long as the code using syscalls does go in dl-sysdep.c rather
> than directly in elf/.


Attached is a revised patch, implementing above, as well as formatting fixes.

Tested on Linux/x86_64. No regressions.

Paul Pluzhnikov

2013-11-06  Andew Hunter  <>
	    Paul Pluzhnikov  <>

	[BZ #16133]

	* elf/Versions (ld): Add _dl_clear_dtv.
	* elf/dl-misc.c (__signal_safe_memalign): New function.
	(__signal_safe_malloc, __signal_safe_free): Likewise.
 	(__signal_safe_realloc, __signal_safe_calloc): Likewise.
	* elf/dl-open.c (dl_open_worker): Comment added.
	* elf/dl-reloc.c (_dl_try_allocate_static_tls): Adjust.
	(_dl_allocate_static_tls): Mask signals.
	* elf/dl-tls.c (allocate_dtv): Use signal-safe allocator.
	(_dl_deallocate_tls, allocate_and_init): Likewise.
	(_dl_update_slotinfo): Likewise.
	(_dl_clear_dtv): New.
	(tls_get_addr_tail): Adjust.
	* nptl/Makefile (tst-tls7): New test.
	* nptl/allocatestack.c (get_cached_stack): Adjust.
	(init_one_static_tls): Adjust.
	* nptl/tst-tls7.c: New test.
	* nptl/tst-tls7mod.c: New test.
	* sysdeps/generic/ldsodefs.h (_dl_mask_all_signals): New.
	(_dl_unmask_signals): Likewise.
	(__signal_safe_memalign, __signal_safe_malloc): Likewise.
	(__signal_safe_free, __signal_safe_realloc): Likewise.
	(__signal_safe_calloc, _dl_clear_dtv): Likewise.
	* sysdeps/mach/hurd/dl-sysdep.h (_dl_mask_all_signals): New stub.
	(_dl_unmask_all_signals): Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.c (_dl_mask_all_signals):
	New function.
	(_dl_unmask_all_signals): Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.h (_dl_mask_all_signals): New.
	(_dl_unmask_all_signals): Likewise.

Attachment: ahh-glibc-20131106.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]