support for __thread
Alfred Perlstein
bright at mu.org
Sun Dec 21 05:56:23 PST 2003
* Alfred Perlstein <bright at mu.org> [031221 02:47] wrote:
> How do I get __thread to work for me?
>
> http://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html
>
> it seems the assembler chokes on it?
Taking this code:
#include <stdio.h>
__thread int x;
int
main(int argc, char **argv)
{
printf("duh:\n");
return (0);
}
Running it through "gcc -S" results in an asm file that has this
at the end:
.globl %lx
.section .tbss,"awT", at nobits
.p2align 2
.type %lx, @object
.size %lx, 4
%lx:
.zero 4
.ident "GCC: (GNU) 3.3.3 [FreeBSD] 20031106"
as(1) will accept this file if I replace all occurrances of
'%lx' with 'lx', it then appears to create special section
called tbss, (this is used for automatic thread specific
data).
Where is the bug, the compiler or the assembler, anyone have
a fix?
--
- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright at mu.org cell: 408-480-4684
More information about the freebsd-hackers
mailing list