Initialize TLS manually on Redox as Linux does.
This MR changes the way TLS is handled on Redox x86_64, to make it identical to Linux except for the platform specific parts. Specifically, rather than having no control over the IA32_FS_BASE
MSR and blindly using 0xB000_0000 + pid * stride
, it now parses the ELF segments as provided by auxiliary vectors, and manually allocates a TCB and TLS memory. In order to write FSBASE on older CPUs which do not support FSGSBASE instructions, it utilizes thisproc:
which is a restricted form of proc:
, meant to be available even in the null namespace.
Depends on syscall!67 (merged) (build-time) and kernel!185 (merged) (runtime).
Edited by Jacob Lorentzon