From patchwork Sun Oct 9 18:56:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 16370 Received: (qmail 35361 invoked by alias); 9 Oct 2016 18:56:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 35349 invoked by uid 89); 9 Oct 2016 18:56:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00, KAM_STOCKGEN, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 spammy=longest 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 ESMTP; Sun, 09 Oct 2016 18:56:45 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E8BC624DB for ; Sun, 9 Oct 2016 18:56:44 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u99Iufr4027703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 9 Oct 2016 14:56:43 -0400 Date: Sun, 9 Oct 2016 20:56:41 +0200 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls Message-ID: <20161009185641.GA13645@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.0 (2016-08-17) X-IsSubscribed: yes Hi, no functionality change, for patch 2/2. Jan gdb/ChangeLog 2016-10-09 Jan Kratochvil * parse.c (write_exp_msymbol): New variable is_tls, use it. --- a/gdb/parse.c +++ b/gdb/parse.c @@ -484,11 +484,13 @@ write_exp_msymbol (struct parser_state *ps, struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol); enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol); CORE_ADDR pc; + const int is_tls = (section != NULL + && section->the_bfd_section->flags & SEC_THREAD_LOCAL); /* The minimal symbol might point to a function descriptor; resolve it to the actual code address instead. */ pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, ¤t_target); - if (pc != addr) + if (!is_tls && pc != addr) { struct bound_minimal_symbol ifunc_msym = lookup_minimal_symbol_by_pc (pc); @@ -520,7 +522,7 @@ write_exp_msymbol (struct parser_state *ps, write_exp_elt_longcst (ps, (LONGEST) addr); write_exp_elt_opcode (ps, OP_LONG); - if (section && section->the_bfd_section->flags & SEC_THREAD_LOCAL) + if (is_tls) { write_exp_elt_opcode (ps, UNOP_MEMVAL_TLS); write_exp_elt_objfile (ps, objfile);