mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Revert "Use %gs as TLS register when dlopen() is linked"
This reverts commit d71da7fc72
.
This commit is contained in:
parent
d71da7fc72
commit
956e68be59
13 changed files with 40 additions and 71 deletions
|
@ -55,13 +55,11 @@ privileged void __morph_tls(void) {
|
|||
// address 0x30 was promised to us, according to Go team
|
||||
// https://github.com/golang/go/issues/23617
|
||||
dis = 0x30;
|
||||
} else if (IsWindows()) {
|
||||
} else {
|
||||
// MSVC __declspec(thread) generates binary code for this
|
||||
// %gs:0x1480 abi. So long as TlsAlloc() isn't called >64
|
||||
// times we should be good.
|
||||
dis = 0x1480 + __tls_index * 8;
|
||||
} else {
|
||||
dis = 0;
|
||||
}
|
||||
|
||||
// iterate over modifiable code looking for 9 byte instruction
|
||||
|
@ -114,7 +112,6 @@ privileged void __morph_tls(void) {
|
|||
}
|
||||
}
|
||||
|
||||
__tls_morphed = true;
|
||||
__morph_end();
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue