aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-04-08 20:04:42 +0000
committerTom Tromey <tromey@redhat.com>2013-04-08 20:04:42 +0000
commit65cf3563597713173bb688287a21666ec66e722d (patch)
tree81c99cb31198d4095c8f7aad732cc2255683225f /gdb/elfread.c
parent7cbd4a934e9cf3808e1199c62e65b4c25b24b4e5 (diff)
downloadfsf-binutils-gdb-65cf3563597713173bb688287a21666ec66e722d.zip
fsf-binutils-gdb-65cf3563597713173bb688287a21666ec66e722d.tar.gz
fsf-binutils-gdb-65cf3563597713173bb688287a21666ec66e722d.tar.bz2
* coffread.c (cs_to_section): Use gdb_bfd_section_index.
* elfread.c (record_minimal_symbol, elf_symtab_read): Use gdb_bfd_section_index. * gdb_bfd.c (gdb_bfd_section_index, gdb_bfd_count_sections): New functions. * gdb_bfd.h (gdb_bfd_section_index, gdb_bfd_count_sections): Declare. * machoread.c (macho_symtab_add_minsym, macho_symfile_offsets): Update. * objfiles.c (add_to_objfile_sections_full): New function. (add_to_objfile_sections): Use it. (build_section_table): Rewrite. (objfile_relocate1): Use gdb_bfd_section_index. Update. * objfiles.h (obj_section_offset): Use gdb_bfd_section_index. (struct objfile) <sections>: Update comment. (ALL_OBJFILE_OSECTIONS): Skip sections where the_bfd_section is NULL. (ALL_OBJSECTIONS): Use it. * solib-dsbt.c (dsbt_relocate_main_executable): Update. * solib-frv.c (frv_relocate_main_executable): Update. * solib-target.c (solib_target_relocate_section_addresses): Use gdb_bfd_section_index. * symfile.c (build_section_addr_info_from_section_table): Use gdb_bfd_section_index. (build_section_addr_info_from_bfd, place_section): Likewise. * symtab.c (fixup_section): Update. * xcoffread.c (find_targ_sec): Use gdb_bfd_section_index.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 866e496..668b974 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -208,7 +208,9 @@ record_minimal_symbol (const char *name, int name_len, int copy_name,
address = gdbarch_addr_bits_remove (gdbarch, address);
return prim_record_minimal_symbol_full (name, name_len, copy_name, address,
- ms_type, bfd_section->index,
+ ms_type,
+ gdb_bfd_section_index (objfile->obfd,
+ bfd_section),
bfd_section, objfile);
}
@@ -271,7 +273,8 @@ elf_symtab_read (struct objfile *objfile, int type,
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))
@@ -326,7 +329,8 @@ elf_symtab_read (struct objfile *objfile, int type,
&& 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,