From 07be84bf8f6a00301ce539a651d1bc717e402b8f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 28 Mar 2011 20:26:24 +0000 Subject: gdb/ STT_GNU_IFUNC reader implementation. * elfread.c: Include gdbtypes.h, value.h and infcall.h. (SYMBOL_GOT_PLT_SUFFIX, elf_rel_plt_read) (elf_objfile_gnu_ifunc_cache_data, struct elf_gnu_ifunc_cache) (elf_gnu_ifunc_cache_hash, elf_gnu_ifunc_cache_eq) (elf_gnu_ifunc_record_cache, elf_gnu_ifunc_resolve_by_cache) (elf_gnu_ifunc_resolve_by_got, elf_gnu_ifunc_resolve_name) (elf_gnu_ifunc_resolve_addr): New. (elf_symfile_read): Call elf_rel_plt_read. (elf_gnu_ifunc_fns): New. (_initialize_elfread): Initialize elf_objfile_gnu_ifunc_cache_data. Install elf_gnu_ifunc_fns. * infcall.c (find_function_return_type): New function. (find_function_addr): Resolve TYPE_GNU_IFUNC functions, if possible. * minsyms.c (stub_gnu_ifunc_resolve_addr) (stub_gnu_ifunc_resolve_name): New functions. (stub_gnu_ifunc_fns, gnu_ifunc_fns_p): New variables. * symtab.h (struct gnu_ifunc_fns, gnu_ifunc_resolve_addr) (gnu_ifunc_resolve_name, gnu_ifunc_fns_p): New. --- gdb/minsyms.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gdb/minsyms.c') diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 534a8b2..80f9497 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -708,6 +708,39 @@ in_gnu_ifunc_stub (CORE_ADDR pc) return msymbol && MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc; } +/* See elf_gnu_ifunc_resolve_addr for its real implementation. */ + +static CORE_ADDR +stub_gnu_ifunc_resolve_addr (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + error (_("GDB cannot resolve STT_GNU_IFUNC symbol at address %s without " + "the ELF support compiled in."), + paddress (gdbarch, pc)); +} + +/* See elf_gnu_ifunc_resolve_name for its real implementation. */ + +static int +stub_gnu_ifunc_resolve_name (const char *function_name, + CORE_ADDR *function_address_p) +{ + error (_("GDB cannot resolve STT_GNU_IFUNC symbol \"%s\" without " + "the ELF support compiled in."), + function_name); +} + +/* See elf_gnu_ifunc_fns for its real implementation. */ + +static const struct gnu_ifunc_fns stub_gnu_ifunc_fns = +{ + stub_gnu_ifunc_resolve_addr, + stub_gnu_ifunc_resolve_name, +}; + +/* A placeholder for &elf_gnu_ifunc_fns. */ + +const struct gnu_ifunc_fns *gnu_ifunc_fns_p = &stub_gnu_ifunc_fns; + /* Find the minimal symbol named NAME, and return both the minsym struct and its objfile. This only checks the linkage name. Sets *OBJFILE_P and returns the minimal symbol, if it is found. If it -- cgit v1.1