From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18502 invoked by alias); 24 Oct 2014 14:40:21 -0000 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 Received: (qmail 18481 invoked by uid 89); 24 Oct 2014 14:40:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Oct 2014 14:40:19 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9OEeIJl006311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 24 Oct 2014 10:40:18 -0400 Received: from host2.jankratochvil.net (ovpn-116-79.ams2.redhat.com [10.36.116.79]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9OEeEgL031434 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 24 Oct 2014 10:40:16 -0400 Date: Fri, 24 Oct 2014 14:40:00 -0000 From: Jan Kratochvil To: "Carlos O'Donell" Cc: libc-alpha@sourceware.org, gdb-patches@sourceware.org Subject: Re: [libc patch] __tls_get_addr with link_map * instead of modid Message-ID: <20141024144014.GA2193@host2.jankratochvil.net> References: <20141018201540.GA26252@host2.jankratochvil.net> <5449B78E.1060407@redhat.com> <20141024093834.GA24090@host2.jankratochvil.net> <544A60A5.4020701@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <544A60A5.4020701@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00642.txt.bz2 On Fri, 24 Oct 2014 16:22:29 +0200, Carlos O'Donell wrote: > What's wrong with using libthread_db to get the module ID and then you can > call the normal TLS functions + > Isn't a solution to use libthread_db to get the module ID from the link_map, > then use that with normal __tls_get_addr instead of adding to ld's API? I forgot about this possibility - that libthread_db would provide just the module ID (and not some per-thread address). Therefore going to post a libthread_db patch later, instead of using _dl_tls_get_addr_soft() which would have one disadvantage I described before to Alex. > > TBH - a bit OT - the whole GDB JIT functionality has many arch specific issues > > and deviations due to the initial decision not to use dlopen() for the GDB JIT > > module because dlopen() may do some unexpected modifications of the inferior. > > I was proposing to simply use dlopen(), Tom Tromey required the mmap(), custom > > loading, custom relocations etc. With dlopen() TLS would not be any issue. > > I don't understand the tradeoffs, but if calling dlopen() in the inferior would > have made life easy, then I would have done that first, regardless of the impact > on the inferior. Only if users complained or found use cases where things broke For GDB the feedback is usually scarce and skewed to drive design decisions. > would I have fallen back on the "technical purist" solution involving doing > everything yourself. Those are decisions that you, as a gdb developer need to > make, or reevaluate and make different. This decision has been already made by gdb developer Tom Tromey and all the work (except this TLS issue) has been hopefully already solved now. I find it a bit late to throw it all alway and choose a different set of advantages and disadvantages. > What I oppose is the addition to ld's ABI and API something which is not going > to be a permanent solution, and for which we can put a function somewhere > else and get similar results. IMO the dlopen() way could be the first simple solution, extending it optionally only upon demand later. Going now back to dlopen() seems a bit backwards to me. Thanks, Jan