Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Dec 2003 05:56:22 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        hackers@freebsd.org
Subject:   Re: support for __thread
Message-ID:  <20031221135622.GU60229@elvis.mu.org>
In-Reply-To: <20031221104724.GT60229@elvis.mu.org>
References:  <20031221104724.GT60229@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Alfred Perlstein <bright@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",@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@mu.org cell: 408-480-4684



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031221135622.GU60229>