ensure that thread dtv pointer is never null to optimize __tls_get_addr
This commit is contained in:
parent
d926565355
commit
44b4d09fc0
2 changed files with 6 additions and 4 deletions
|
|
@ -17,6 +17,8 @@ static int init_main_thread()
|
|||
main_thread->self = main_thread;
|
||||
main_thread->tid = main_thread->pid =
|
||||
__syscall(SYS_set_tid_address, &main_thread->tid);
|
||||
if (!main_thread->dtv)
|
||||
main_thread->dtv = (void *)dummy;
|
||||
libc.main_thread = main_thread;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue