Jan Kratochvil d08a20f
http://sourceware.org/ml/gdb-patches/2016-10/msg00206.html
Jan Kratochvil d08a20f
Subject: [patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
--XMCwj5IQnwKtuyBG
Jan Kratochvil d08a20f
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil d08a20f
Content-Disposition: inline
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
Hi,
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
no functionality change, for patch 2/2.
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
Jan
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
--XMCwj5IQnwKtuyBG
Jan Kratochvil d08a20f
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil d08a20f
Content-Disposition: inline; filename="tls1.patch"
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
gdb/ChangeLog
Jan Kratochvil d08a20f
2016-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
	* parse.c (write_exp_msymbol): New variable is_tls, use it.
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
--- a/gdb/parse.c
Jan Kratochvil d08a20f
+++ b/gdb/parse.c
Jan Kratochvil d08a20f
@@ -484,6 +484,8 @@ write_exp_msymbol (struct parser_state *ps,
Jan Kratochvil d08a20f
   struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
Jan Kratochvil d08a20f
   enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
Jan Kratochvil d08a20f
   CORE_ADDR pc;
Jan Kratochvil d08a20f
+  const int is_tls = (section != NULL
Jan Kratochvil d08a20f
+		      && section->the_bfd_section->flags & SEC_THREAD_LOCAL);
Jan Kratochvil d08a20f
 
Jan Kratochvil d08a20f
   /* The minimal symbol might point to a function descriptor;
Jan Kratochvil d08a20f
      resolve it to the actual code address instead.  */
Jan Kratochvil d08a20f
@@ -520,7 +522,7 @@ write_exp_msymbol (struct parser_state *ps,
Jan Kratochvil d08a20f
   write_exp_elt_longcst (ps, (LONGEST) addr);
Jan Kratochvil d08a20f
   write_exp_elt_opcode (ps, OP_LONG);
Jan Kratochvil d08a20f
 
Jan Kratochvil d08a20f
-  if (section && section->the_bfd_section->flags & SEC_THREAD_LOCAL)
Jan Kratochvil d08a20f
+  if (is_tls)
Jan Kratochvil d08a20f
     {
Jan Kratochvil d08a20f
       write_exp_elt_opcode (ps, UNOP_MEMVAL_TLS);
Jan Kratochvil d08a20f
       write_exp_elt_objfile (ps, objfile);
Jan Kratochvil d08a20f
Jan Kratochvil d08a20f
--XMCwj5IQnwKtuyBG--
Jan Kratochvil d08a20f