From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 21 05:56:23 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5152116A4CE; Sun, 21 Dec 2003 05:56:23 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F80043D53; Sun, 21 Dec 2003 05:56:22 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 8533F5C7C9; Sun, 21 Dec 2003 05:56:22 -0800 (PST) Date: Sun, 21 Dec 2003 05:56:22 -0800 From: Alfred Perlstein To: hackers@freebsd.org Message-ID: <20031221135622.GU60229@elvis.mu.org> References: <20031221104724.GT60229@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031221104724.GT60229@elvis.mu.org> User-Agent: Mutt/1.4.1i X-Mailman-Approved-At: Sun, 21 Dec 2003 11:43:52 -0800 Subject: Re: support for __thread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Dec 2003 13:56:23 -0000 * Alfred Perlstein [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 __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