-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TLS support #28
Add TLS support #28
Conversation
src/compartment.c
Outdated
if (to_map->libs[i]->tls_data_size != (size_t) -1) | ||
{ | ||
assert(to_map->libs[i]->tls_sec_addr); | ||
// TODO why 4? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed... Why 4?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I, uh, don't know. It seems to work with sizeof(void*)
, so I changed the question now to "Why sizeof(void*)
. This might be related to why printf
doesn't work, but can't say without some in-depth debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, managed to uncover and fix an issue with subsequent library TLS regions (as I hinted) in f47b3c9. This was also part of that fix.
I think this is ready for squashing? |
Let me just double check the last unresolved comment, maybe I can figure out why it works with both 4 and |
Please squash. |
Initial support for `_Thread_local` (and `_Thread_local static`) variables. Limitations: * Supports a single TLS region, but amenable to future extensions if we want to implement multi-threaded compartments; * Handles only symbols of type `TLSDESC`. Other changes: * Remove some old `struct Compartment` member variables that are now unneeded; * Add `print_comp` back; * Fix a bug regarding calculating scratch memory size for compartments; * Fixed a bug with setting relocation target addresses.
b2830ff
to
dacb4af
Compare
Squashed. |
Initial support for
_Thread_local
(and_Thread_local static
) variables.Limitations:
TLSDESC
.Other changes:
struct Compartment
member variables that are now unneeded;print_comp
back;