/* Read ELF (Executable and Linking Format) object files for GDB.
- Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
struct elfinfo
{
- file_ptr dboffset; /* Offset to dwarf debug section */
- unsigned int dbsize; /* Size of dwarf debug section */
- file_ptr lnoffset; /* Offset to dwarf line number section */
- unsigned int lnsize; /* Size of dwarf line number section */
asection *stabsect; /* Section pointer for .stab section */
asection *stabindexsect; /* Section pointer for .stab.index section */
asection *mdebugsect; /* Section pointer for .mdebug section */
struct elfinfo *ei;
ei = (struct elfinfo *) eip;
- if (strcmp (sectp->name, ".debug") == 0)
- {
- ei->dboffset = sectp->filepos;
- ei->dbsize = bfd_get_section_size (sectp);
- }
- else if (strcmp (sectp->name, ".line") == 0)
- {
- ei->lnoffset = sectp->filepos;
- ei->lnsize = bfd_get_section_size (sectp);
- }
- else if (strcmp (sectp->name, ".stab") == 0)
+ if (strcmp (sectp->name, ".stab") == 0)
{
ei->stabsect = sectp;
}
asection *bfd_section, struct objfile *objfile)
{
if (ms_type == mst_text || ms_type == mst_file_text)
- address = SMASH_TEXT_ADDRESS (address);
+ address = gdbarch_smash_text_address (current_gdbarch, address);
return prim_record_minimal_symbol_and_info
(name, address, ms_type, NULL, bfd_section->index, bfd_section, objfile);
}
else if (sym->section->flags & SEC_CODE)
{
- if (sym->flags & BSF_GLOBAL)
+ if (sym->flags & (BSF_GLOBAL | BSF_WEAK))
{
ms_type = mst_text;
}
if (msym != NULL)
msym->filename = filesymname;
#endif
- ELF_MAKE_MSYMBOL_SPECIAL (sym, msym);
+ gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym);
}
}
}
We look for sections with specific names, to tell us what debug
format to look for: FIXME!!!
- dwarf_build_psymtabs() builds psymtabs for DWARF symbols;
elfstab_build_psymtabs() handles STABS symbols;
mdebug_build_psymtabs() handles ECOFF debugging information.
/* DWARF 2 sections */
dwarf2_build_psymtabs (objfile, mainline);
}
- else if (ei.dboffset && ei.lnoffset)
- {
- /* DWARF sections */
- dwarf_build_psymtabs (objfile,
- mainline,
- ei.dboffset, ei.dbsize,
- ei.lnoffset, ei.lnsize);
- }
/* FIXME: kettenis/20030504: This still needs to be integrated with
dwarf2read.c in a better way. */