Thread-local Storage
Which ports have thread-local storage support in gcc/binutils?
Architecture | GCC | Binutils |
---|---|---|
alpha | Yes | Yes |
arm | Yes | Yes |
hppa | Yes | Yes |
i386 | Yes | Yes |
m68k | Underway | Underway |
mips | Yes | Yes |
powerpc | Yes | Yes |
sh | Yes | Yes |
sparc | Yes | Yes |
sparc64 | Yes | Yes |
vax | No | No |
x86_64 | Yes | Yes |
Phase 1: Kernel support
Area | Task | Responsible | Progress |
---|---|---|---|
LWP Private data | Define __HAVE_CPU_LWP_SETPRIVATE for the ports that need it. | All | Underway |
Modify ucontext_t to store/retrieve the LWP private data. | mjf | Underway | |
Version setcontext(2) and getcontext(2). | mjf | Underway |
Phase 2: MI dynamic linker support
Area | Task | Responsible | Progress |
---|---|---|---|
Initialization | Parse PT_TLS phdrs and create initialization image. | None | |
Module (object) ID generation. | None | ||
Static model | Allocation of TLS blocks for objects. | None | |
Dynamic model | Lazy allocation of TLS blocks. | None | |
Dynamic thread vector | None |
Phase 3: MD dynamic linker and libpthread support
Architecture | TLS relocs progress | __tls_get_addr() progress | Responsible |
---|---|---|---|
alpha | None | None | |
arm | None | None | |
hppa | None | None | skrll, mjf |
i386 | None | None | |
mips | None | None | |
powerpc | None | None | |
sh | None | None | mjf |
sparc | None | None | |
sparc64 | None | None | |
x86_64 | None | None |
Phase 4: MI libpthread support
Area | Task | Responsible | Progress |
---|---|---|---|
Interfaces | Implement a pthread_tcb() function for each port. | None | |
LWP startup | Copy .tdata section for newly created LWP. | None | |
Misc. | Use the thread register to improve performance for pthread_self() | None | |
Investigate bug reports that were opened because of the broken pthread_self()/signal interaction. Currently pthread_self() does not work in signal handlers that use an alternate stack, e.g. stack + libpthread doesn't work. By implementing pthread_self() with a thread regsiter these bugs go away. | None |