I'm trying to understand how the TLS is setup for the root server on x64 (to access for example the IPC buffer)
but I'm failing to connect the pieces and how the server is correctly setting the FS register.
For example the sel4_Send function is codegen like this (using -ftls-model=local-exec)
The instruction `mov rax,[fs:0]` is accessing the seL4_IPCBuffer* and the the executable has a TLS segments of 8 bytes for
the pointer. all good.
Now, I'm failing to find in the codebase where the ELF loader is actually detecting the TLS segment and the according setup with the TLS register.
And I'm wondering if the setup for the codegen is not wrong on my side (e.g the local-exec is not working), so that instead of having a FS register
it would be a direct memory access.
Does anyone have a clue about this?