From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5185 invoked by alias); 2 Dec 2008 14:53:58 -0000 Received: (qmail 5173 invoked by uid 22791); 2 Dec 2008 14:53:58 -0000 X-Spam-Check-By: sourceware.org Received: from ns.intrepid.com (HELO mail.intrepid.com) (74.95.8.113) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Dec 2008 14:53:23 +0000 Received: from screamer.local (screamer.local [10.10.1.2]) by mail.intrepid.com (8.13.8/8.13.8) with ESMTP id mB2EqlV0003148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Dec 2008 06:52:47 -0800 Received: from screamer.local (screamer.local [127.0.0.1]) by screamer.local (8.14.2/8.14.2) with ESMTP id mB2Eqluc016898; Tue, 2 Dec 2008 06:52:47 -0800 Received: (from gary@localhost) by screamer.local (8.14.2/8.14.2/Submit) id mB2EqkjI016897; Tue, 2 Dec 2008 06:52:46 -0800 Date: Tue, 02 Dec 2008 14:53:00 -0000 From: Gary Funck To: Ulrich Weigand Cc: Jan Kratochvil , Vinay Sridhar , gdb-patches@sources.redhat.com, Daniel Jacobowitz , luisgpm@linux.vnet.ibm.com Subject: Re: [patch] Accessing tls variables across files causes a bug Message-ID: <20081202145246.GC15483@intrepid.com> References: <20081201215236.GA17136@host0.dyn.jankratochvil.net> <200812021352.mB2DqXqT015979@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200812021352.mB2DqXqT015979@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00035.txt.bz2 On 12/02/08 14:52:33, Ulrich Weigand wrote: > > 2008-12-01 Jan Kratochvil > > > > Fix resolving external references to TLS variables. > > * findvar.c: Include `objfiles.h'. > > (read_var_value ): New variable `obj_section'. Handle > > SEC_THREAD_LOCAL variables. > > * printcmd.c (address_info ): Handle SEC_THREAD_LOCAL > > variables. > > > > 2008-12-01 Jan Kratochvil > > > > Test resolving external references to TLS variables. > > * gdb.threads/tls.exp: New tests to examine A_THREAD_LOCAL and > > FILE2_THREAD_LOCAL. > > (testfile2, srcfile2): New variables. > > * gdb.threads/tls.c (file2_thread_local) > > (function_referencing_file2_thread_local): New. > > * gdb.threads/tls2.c: New file. > > This is OK. Thanks, Ulrich If anyone ports this patch to 6.8 or can share what's needed to implement the patch in 6.8, I'd appreciate learning about that. I quickly tried it, and it seems that this part of the fix runs into difficulties: diff -r1.4 findvar.c 36a37 > #include "objfiles.h" 580a582 > struct obj_section *obj_section; 589a592,596 > > obj_section = SYMBOL_OBJ_SECTION (msym); > if (obj_section > && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0) > addr = target_translate_tls_address (obj_section->objfile, addr); with related difficulties in printcmd.c. SYMBOL_OBJ_SECTION was introduced in this mod to symtab.h revision 1.131 date: 2008/09/05 11:37:17; author: uweigand; state: Exp; lines: +17 -15 * breakpoint.h (struct bp_location): Change type of section member to "struct obj_section *". * tracepoint.h (struct tracepoint): Likewise. * symtab.h (struct general_symbol_info): Replace bfd_section member with obj_section. (struct symtab_and_line): Change type of section member to "struct obj_section *". (SYMBOL_BFD_SECTION): Remove macro, replace by ... (SYMBOL_OBJ_SECTION): ... this. thanks, - Gary