address = gdbarch_addr_bits_remove (gdbarch, address);
return prim_record_minimal_symbol_full (name, name_len, copy_name, address,
- ms_type, bfd_section->index,
- bfd_section, objfile);
+ ms_type,
+ gdb_bfd_section_index (objfile->obfd,
+ bfd_section),
+ objfile);
}
/* Read the symbol table of an ELF file.
continue;
}
- offset = ANOFFSET (objfile->section_offsets, sym->section->index);
+ offset = ANOFFSET (objfile->section_offsets,
+ gdb_bfd_section_index (objfile->obfd, sym->section));
if (type == ST_DYNAMIC
&& sym->section == bfd_und_section_ptr
&& (sym->flags & BSF_FUNCTION))
&& bfd_get_section_by_name (abfd, ".plt") != NULL)
continue;
- symaddr += ANOFFSET (objfile->section_offsets, sect->index);
+ symaddr += ANOFFSET (objfile->section_offsets,
+ gdb_bfd_section_index (objfile->obfd, sect));
msym = record_minimal_symbol
(sym->name, strlen (sym->name), copy_names,
}
else if (sym->flags & BSF_SECTION_SYM)
continue;
- else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
+ else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK
+ | BSF_GNU_UNIQUE))
{
struct minimal_symbol *msym;
}
else if (sym->section->flags & SEC_CODE)
{
- if (sym->flags & (BSF_GLOBAL | BSF_WEAK))
+ if (sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE))
{
if (sym->flags & BSF_GNU_INDIRECT_FUNCTION)
ms_type = mst_text_gnu_ifunc;
}
else if (sym->section->flags & SEC_ALLOC)
{
- if (sym->flags & (BSF_GLOBAL | BSF_WEAK))
+ if (sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_GNU_UNIQUE))
{
if (sym->section->flags & SEC_LOAD)
{
if (msym)
{
- /* Pass symbol size field in via BFD. FIXME!!! */
- elf_symbol_type *elf_sym;
-
/* NOTE: uweigand-20071112: A synthetic symbol does not have an
- ELF-private part. However, in some cases (e.g. synthetic
- 'dot' symbols on ppc64) the udata.p entry is set to point back
- to the original ELF symbol it was derived from. Get the size
- from that symbol. */
+ ELF-private part. */
if (type != ST_SYNTHETIC)
- elf_sym = (elf_symbol_type *) sym;
- else
- elf_sym = (elf_symbol_type *) sym->udata.p;
-
- if (elf_sym)
- SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
+ {
+ /* Pass symbol size field in via BFD. FIXME!!! */
+ elf_symbol_type *elf_sym = (elf_symbol_type *) sym;
+ SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size);
+ }
msym->filename = filesymname;
gdbarch_elf_make_msymbol_special (gdbarch, sym, msym);
static int
elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
{
- struct minimal_symbol *msym;
+ struct bound_minimal_symbol msym;
asection *sect;
struct objfile *objfile;
htab_t htab;
void **slot;
msym = lookup_minimal_symbol_by_pc (addr);
- if (msym == NULL)
+ if (msym.minsym == NULL)
return 0;
- if (SYMBOL_VALUE_ADDRESS (msym) != addr)
+ if (SYMBOL_VALUE_ADDRESS (msym.minsym) != addr)
return 0;
/* minimal symbols have always SYMBOL_OBJ_SECTION non-NULL. */
- sect = SYMBOL_OBJ_SECTION (msym)->the_bfd_section;
- objfile = SYMBOL_OBJ_SECTION (msym)->objfile;
+ sect = SYMBOL_OBJ_SECTION (msym.objfile, msym.minsym)->the_bfd_section;
+ objfile = msym.objfile;
/* If .plt jumps back to .plt the symbol is still deferred for later
resolution and it has no use for GDB. Besides ".text" this symbol can
bfd_section_size (abfd, str_sect));
}
+ if (symtab_create_debug)
+ fprintf_unfiltered (gdb_stdlog, "Done reading minimal symbols.\n");
+
if (dwarf2_has_info (objfile, NULL))
{
/* elf_sym_fns_gdb_index cannot handle simultaneous non-DWARF debug
do_cleanups (cleanup);
}
}
-
- if (symtab_create_debug)
- fprintf_unfiltered (gdb_stdlog, "Done reading minimal symbols.\n");
}
/* Callback to lazily read psymtabs. */