diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index f5ef29aaec85..5b40a0b7ab97 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5462,6 +5462,11 @@ unref_dag(Obj_Entry *root) /* * Common code for MD __tls_get_addr(). + * + * The tcb->tcb_dtv data structure is thread-local. The reason that + * the function needs to take the rtld_bind_lock exclusive (as opposed + * to only shared, to safely access obj_list in allocate_module_tls()) + * is to protect the rtld_malloc data. */ static void * tls_get_addr_slow(struct tcb *tcb, int index, size_t offset, bool locked)