mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 08:48:29 +00:00
Make _Thread_local more seamlessly working
This commit is contained in:
parent
5f4f6b0e69
commit
5fa77f1e8f
23 changed files with 217 additions and 283 deletions
|
@ -76,6 +76,23 @@ cosmo: push %rbp
|
|||
ret
|
||||
.endfn cosmo,weak
|
||||
|
||||
#if !IsTiny()
|
||||
// Enable TLS early if _Thread_local is used
|
||||
// In MODE=tiny you may need to explicitly call __enable_tls()
|
||||
// Otherwise this would bloat life.com from 16kb → 32kb D:
|
||||
.init.start 304,_init_tls
|
||||
mov $_tls_content,%eax
|
||||
test %eax,%eax
|
||||
jz 1f
|
||||
push %rdi
|
||||
push %rsi
|
||||
call __enable_tls
|
||||
pop %rsi
|
||||
pop %rdi
|
||||
jz 1f
|
||||
1: .init.end 304,_init_tls
|
||||
#endif
|
||||
|
||||
#if !IsTiny()
|
||||
// Creates deterministically addressed stack we can use
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue