This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 9 Oct 2016 20:56:41 +0200
- Subject: [patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls
- Authentication-results: sourceware.org; auth=none
Hi,
no functionality change, for patch 2/2.
Jan
gdb/ChangeLog
2016-10-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* 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);