X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Felfread.c;h=7b9c3e60775aa40e28c71c4c700996f87976a50f;hb=8b1ca062713c30f40c1fb4ab889f048a97c38f3b;hp=9cc89e662e33b5b8364d2135e534ab4db74d3615;hpb=8b92e4d54f80aae37af6b0b2a23e114ae4b5d29d;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/elfread.c b/gdb/elfread.c index 9cc89e662e..7b9c3e6077 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -83,12 +83,12 @@ elf_locate_sections (bfd *ignore_abfd, asection *sectp, void *eip) if (strcmp (sectp->name, ".debug") == 0) { ei->dboffset = sectp->filepos; - ei->dbsize = bfd_get_section_size_before_reloc (sectp); + ei->dbsize = bfd_get_section_size (sectp); } else if (strcmp (sectp->name, ".line") == 0) { ei->lnoffset = sectp->filepos; - ei->lnsize = bfd_get_section_size_before_reloc (sectp); + ei->lnsize = bfd_get_section_size (sectp); } else if (strcmp (sectp->name, ".stab") == 0) { @@ -159,10 +159,10 @@ elf_symtab_read (struct objfile *objfile, int dynamic) seen any section info for it yet. */ asymbol *filesym = 0; #ifdef SOFUN_ADDRESS_MAYBE_MISSING - /* Name of filesym, as saved on the symbol_obstack. */ - char *filesymname = obsavestring ("", 0, &objfile->symbol_obstack); + /* Name of filesym, as saved on the objfile_obstack. */ + char *filesymname = obsavestring ("", 0, &objfile->objfile_obstack); #endif - struct dbx_symfile_info *dbx = objfile->sym_stab_info; + struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info; int stripped = (bfd_get_symcount (objfile->obfd) == 0); if (dynamic) @@ -251,7 +251,7 @@ elf_symtab_read (struct objfile *objfile, int dynamic) #ifdef SOFUN_ADDRESS_MAYBE_MISSING filesymname = obsavestring ((char *) filesym->name, strlen (filesym->name), - &objfile->symbol_obstack); + &objfile->objfile_obstack); #endif } else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK)) @@ -377,7 +377,7 @@ elf_symtab_read (struct objfile *objfile, int dynamic) + (sizeof (CORE_ADDR) * max_index)); sectinfo = (struct stab_section_info *) - xmmalloc (objfile->md, size); + xmalloc (size); memset (sectinfo, 0, size); sectinfo->num_sections = max_index; if (filesym == NULL) @@ -498,13 +498,13 @@ elf_symfile_read (struct objfile *objfile, int mainline) memset ((char *) &ei, 0, sizeof (ei)); /* Allocate struct to keep track of the symfile */ - objfile->sym_stab_info = (struct dbx_symfile_info *) - xmmalloc (objfile->md, sizeof (struct dbx_symfile_info)); - memset ((char *) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info)); + objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *) + xmalloc (sizeof (struct dbx_symfile_info)); + memset ((char *) objfile->deprecated_sym_stab_info, 0, sizeof (struct dbx_symfile_info)); make_cleanup (free_elfinfo, (void *) objfile); /* Process the normal ELF symbol table first. This may write some - chain of info into the dbx_symfile_info in objfile->sym_stab_info, + chain of info into the dbx_symfile_info in objfile->deprecated_sym_stab_info, which can later be used by elfstab_offset_sections. */ elf_symtab_read (objfile, 0); @@ -575,7 +575,7 @@ elf_symfile_read (struct objfile *objfile, int mainline) str_sect->filepos, bfd_section_size (abfd, str_sect)); } - if (dwarf2_has_info (abfd)) + if (dwarf2_has_info (objfile)) { /* DWARF 2 sections */ dwarf2_build_psymtabs (objfile, mainline); @@ -594,21 +594,22 @@ elf_symfile_read (struct objfile *objfile, int mainline) dwarf2_build_frame_info (objfile); } -/* This cleans up the objfile's sym_stab_info pointer, and the chain of - stab_section_info's, that might be dangling from it. */ +/* This cleans up the objfile's deprecated_sym_stab_info pointer, and + the chain of stab_section_info's, that might be dangling from + it. */ static void free_elfinfo (void *objp) { struct objfile *objfile = (struct objfile *) objp; - struct dbx_symfile_info *dbxinfo = objfile->sym_stab_info; + struct dbx_symfile_info *dbxinfo = objfile->deprecated_sym_stab_info; struct stab_section_info *ssi, *nssi; ssi = dbxinfo->stab_section_info; while (ssi) { nssi = ssi->next; - xmfree (objfile->md, ssi); + xfree (ssi); ssi = nssi; } @@ -637,9 +638,9 @@ elf_new_init (struct objfile *ignore) static void elf_symfile_finish (struct objfile *objfile) { - if (objfile->sym_stab_info != NULL) + if (objfile->deprecated_sym_stab_info != NULL) { - xmfree (objfile->md, objfile->sym_stab_info); + xfree (objfile->deprecated_sym_stab_info); } } @@ -673,7 +674,7 @@ void elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst) { char *filename = pst->filename; - struct dbx_symfile_info *dbx = objfile->sym_stab_info; + struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info; struct stab_section_info *maybe = dbx->stab_section_info; struct stab_section_info *questionable = 0; int i;