aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-03-28 20:21:04 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-03-28 20:21:04 +0000
commit0875794a962c041bde76423e980875a467bb0bbe (patch)
treebab7168364c38c5ad57ad405357258cbb8221348 /gdb/parse.c
parentd0fb5eaead43c6b5e73b113227b1be71c07fd213 (diff)
downloadgdb-0875794a962c041bde76423e980875a467bb0bbe.zip
gdb-0875794a962c041bde76423e980875a467bb0bbe.tar.gz
gdb-0875794a962c041bde76423e980875a467bb0bbe.tar.bz2
gdb/
GDB internal type support for STT_GNU_IFUNC. * elfread.c (record_minimal_symbol): Support mst_text_gnu_ifunc. (elf_symtab_read): Set mst_text_gnu_ifunc for BSF_GNU_INDIRECT_FUNCTION. * eval.c (evaluate_subexp_standard): Support TYPE_GNU_IFUNC. * gdbtypes.c (init_type): Support TYPE_FLAG_GNU_IFUNC, builtin_func_func, nodebug_text_gnu_ifunc_symbol and nodebug_got_plt_symbol. * gdbtypes.h (enum type_flag_value): New entry TYPE_FLAG_GNU_IFUNC. (TYPE_GNU_IFUNC): New. (struct main_type): New field flag_gnu_ifunc. (struct builtin_type): New field builtin_func_func. (struct objfile_type): New fields nodebug_text_gnu_ifunc_symbol and nodebug_got_plt_symbol. * minsyms.c (lookup_minimal_symbol_text): Support mst_text_gnu_ifunc. (in_gnu_ifunc_stub): New. (prim_record_minimal_symbol, find_solib_trampoline_target): Support mst_text_gnu_ifunc. * parse.c (write_exp_msymbol): New variable ifunc_msym. Detect and support mst_text_gnu_ifunc. Support mst_slot_got_plt. * solib-svr4.c (svr4_in_dynsym_resolve_code): Return true also for in_gnu_ifunc_stub. * symmisc.c (dump_msymbols): Support mst_text_gnu_ifunc. * symtab.c (search_symbols): Likewise. * symtab.h (enum minimal_symbol_type): New fields mst_text_gnu_ifunc and mst_slot_got_plt. (in_gnu_ifunc_stub): New declaration.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index 02a7d89..4815854 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -487,9 +487,22 @@ write_exp_msymbol (struct minimal_symbol *msymbol)
pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, &current_target);
if (pc != addr)
{
+ struct minimal_symbol *ifunc_msym = lookup_minimal_symbol_by_pc (pc);
+
/* In this case, assume we have a code symbol instead of
a data symbol. */
- type = mst_text;
+
+ if (ifunc_msym != NULL && MSYMBOL_TYPE (ifunc_msym) == mst_text_gnu_ifunc
+ && SYMBOL_VALUE_ADDRESS (ifunc_msym) == pc)
+ {
+ /* A function descriptor has been resolved but PC is still in the
+ STT_GNU_IFUNC resolver body (such as because inferior does not
+ run to be able to call it). */
+
+ type = mst_text_gnu_ifunc;
+ }
+ else
+ type = mst_text;
section = NULL;
addr = pc;
}
@@ -521,6 +534,11 @@ write_exp_msymbol (struct minimal_symbol *msymbol)
write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol);
break;
+ case mst_text_gnu_ifunc:
+ write_exp_elt_type (objfile_type (objfile)
+ ->nodebug_text_gnu_ifunc_symbol);
+ break;
+
case mst_data:
case mst_file_data:
case mst_bss:
@@ -528,6 +546,10 @@ write_exp_msymbol (struct minimal_symbol *msymbol)
write_exp_elt_type (objfile_type (objfile)->nodebug_data_symbol);
break;
+ case mst_slot_got_plt:
+ write_exp_elt_type (objfile_type (objfile)->nodebug_got_plt_symbol);
+ break;
+
default:
write_exp_elt_type (objfile_type (objfile)->nodebug_unknown_symbol);
break;