#include "location.h"
#include "auxv.h"
-/* Forward declarations. */
-extern const struct sym_fns elf_sym_fns_gdb_index;
-extern const struct sym_fns elf_sym_fns_lazy_psyms;
-
/* The struct elfinfo is available only during ELF symbol table and
psymtab reading. It is destroyed at the completion of psymtab-reading.
It's local to elf_symfile_read. */
/* Name of the last file symbol. This is either a constant string or is
saved on the objfile's filename cache. */
const char *filesymname = "";
- struct dbx_symfile_info *dbx = DBX_SYMFILE_INFO (objfile);
int stripped = (bfd_get_symcount (objfile->obfd) == 0);
int elf_make_msymbol_special_p
= gdbarch_elf_make_msymbol_special_p (gdbarch);
sal.pc = prev_pc;
sal.section = find_pc_overlay (sal.pc);
sal.explicit_pc = 1;
- b_return = set_momentary_breakpoint (get_frame_arch (prev_frame), sal,
- prev_frame_id,
- bp_gnu_ifunc_resolver_return);
+ b_return
+ = set_momentary_breakpoint (get_frame_arch (prev_frame), sal,
+ prev_frame_id,
+ bp_gnu_ifunc_resolver_return).release ();
/* set_momentary_breakpoint invalidates PREV_FRAME. */
prev_frame = NULL;
struct elfinfo ei;
memset ((char *) &ei, 0, sizeof (ei));
- bfd_map_over_sections (abfd, elf_locate_sections, (void *) & ei);
+ if (!(objfile->flags & OBJF_READNEVER))
+ bfd_map_over_sections (abfd, elf_locate_sections, (void *) & ei);
elf_read_minimal_symbols (objfile, symfile_flags, &ei);
information present in OBJFILE. If there is such debug info present
never use .gdb_index. */
- if (!objfile_has_partial_symbols (objfile)
- && dwarf2_initialize_objfile (objfile))
- objfile_set_sym_fns (objfile, &elf_sym_fns_gdb_index);
- else
+ if (objfile_has_partial_symbols (objfile))
{
/* It is ok to do this even if the stabs reader made some
partial symbols, because OBJF_PSYMTABS_READ has not been
when needed. */
objfile_set_sym_fns (objfile, &elf_sym_fns_lazy_psyms);
}
+ else
+ objfile_set_sym_fns (objfile, &dwarf2_initialize_objfile (objfile));
}
/* If the file has its own symbol tables it has no separate debug
info. `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to
/* Here we try to gather information about all types of probes from the
objfile. */
- for (const probe_ops *ops : all_probe_ops)
+ for (const static_probe_ops *ops : all_static_probe_ops)
ops->get_probes (probes_per_bfd, objfile);
set_bfd_data (objfile->obfd, probe_key, probes_per_bfd);
{
std::vector<probe *> *probes = (std::vector<probe *> *) d;
- for (struct probe *probe : *probes)
- probe->pops->destroy (probe);
+ for (probe *p : *probes)
+ delete p;
delete probes;
}
&dwarf2_gdb_index_functions
};
+/* The same as elf_sym_fns, but not registered and uses the
+ DWARF-specific .debug_names index rather than psymtab. */
+const struct sym_fns elf_sym_fns_debug_names =
+{
+ elf_new_init, /* init anything gbl to entire symab */
+ elf_symfile_init, /* read initial info, setup for sym_red() */
+ elf_symfile_read, /* read a symbol file into symtab */
+ NULL, /* sym_read_psymbols */
+ elf_symfile_finish, /* finished with file, cleanup */
+ default_symfile_offsets, /* Translate ext. to int. relocatin */
+ elf_symfile_segments, /* Get segment information from a file. */
+ NULL,
+ default_symfile_relocate, /* Relocate a debug section. */
+ &elf_probe_fns, /* sym_probe_fns */
+ &dwarf2_debug_names_functions
+};
+
/* STT_GNU_IFUNC resolver vector to be installed to gnu_ifunc_fns_p. */
static const struct gnu_ifunc_fns elf_gnu_ifunc_fns =