diff --git a/porting/linux/user/ldso/dynlink.c b/porting/linux/user/ldso/dynlink.c index d6a97bf07afaa7a4f0508809b77407b80d28cb8c..58f4f06441716eddefd3be3a1c6155483e8cd372 100644 --- a/porting/linux/user/ldso/dynlink.c +++ b/porting/linux/user/ldso/dynlink.c @@ -3162,8 +3162,8 @@ static void *dlopen_impl( trace_marker_reset(); trace_marker_begin(HITRACE_TAG_MUSL, "dlopen: ", file); - debug.state = RT_ADD; - _dl_debug_state(); + /* debug.state = RT_ADD; */ + /* _dl_debug_state(); */ /* When namespace does not exist, use caller's namespce * and when caller does not exist, use default namespce. */ caller = (struct dso *)addr2dso((size_t)caller_addr); @@ -3352,12 +3352,20 @@ static void *dlopen_impl( update_tls_size(); if (tls_cnt != orig_tls_cnt) install_new_tls(); + + if (orig_tail != tail) { + debug.state = RT_ADD; + _dl_debug_state(); + debug.state = RT_CONSISTENT; + _dl_debug_state(); + } + orig_tail = tail; p = dlopen_post(p, mode); end: - debug.state = RT_CONSISTENT; - _dl_debug_state(); + /* debug.state = RT_CONSISTENT; */ + /* _dl_debug_state(); */ #ifdef LOAD_ORDER_RANDOMIZATION if (!is_task_appended) { free_task(task);