+ struct obj_section *section = find_pc_section (pc);
+
+ if (section == NULL)
+ {
+ struct bound_minimal_symbol result;
+
+ memset (&result, 0, sizeof (result));
+ return result;
+ }
+ return lookup_minimal_symbol_by_pc_section_1 (pc, section, 0);
+}
+
+/* Return non-zero iff PC is in an STT_GNU_IFUNC function resolver. */
+
+int
+in_gnu_ifunc_stub (CORE_ADDR pc)
+{
+ struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc);
+
+ return msymbol.minsym && MSYMBOL_TYPE (msymbol.minsym) == 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_resolver_stop for its real implementation. */
+
+static void
+stub_gnu_ifunc_resolver_stop (struct breakpoint *b)
+{
+ internal_error (__FILE__, __LINE__,
+ _("elf_gnu_ifunc_resolver_stop cannot be reached."));
+}
+
+/* See elf_gnu_ifunc_resolver_return_stop for its real implementation. */
+
+static void
+stub_gnu_ifunc_resolver_return_stop (struct breakpoint *b)
+{
+ internal_error (__FILE__, __LINE__,
+ _("elf_gnu_ifunc_resolver_return_stop cannot be reached."));
+}
+
+/* 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,
+ stub_gnu_ifunc_resolver_stop,
+ stub_gnu_ifunc_resolver_return_stop,
+};
+
+/* A placeholder for &elf_gnu_ifunc_fns. */
+
+const struct gnu_ifunc_fns *gnu_ifunc_fns_p = &stub_gnu_ifunc_fns;
+
+/* See minsyms.h. */
+
+struct bound_minimal_symbol
+lookup_minimal_symbol_and_objfile (const char *name)
+{
+ struct bound_minimal_symbol result;
+ struct objfile *objfile;
+ unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
+
+ ALL_OBJFILES (objfile)
+ {
+ struct minimal_symbol *msym;
+
+ for (msym = objfile->per_bfd->msymbol_hash[hash];
+ msym != NULL;
+ msym = msym->hash_next)
+ {
+ if (strcmp (MSYMBOL_LINKAGE_NAME (msym), name) == 0)
+ {
+ result.minsym = msym;
+ result.objfile = objfile;
+ return result;
+ }
+ }
+ }
+
+ memset (&result, 0, sizeof (result));
+ return result;