This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls


no functionality change, for patch 2/2.

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, &current_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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]