summaryrefslogtreecommitdiff
path: root/gdb/symfile.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
commite78df53764c2576f39a433ed9f16d270f11e1b05 (patch)
tree64117fc5045ea987fe83c83537f5dcbd385c07cd /gdb/symfile.c
parent6aa27e60ba114f43a954ecbdce9d453820bb0c3b (diff)
downloadgdb-e78df53764c2576f39a433ed9f16d270f11e1b05.tar.gz
* 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/symfile.c')
-rw-r--r--gdb/symfile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index edb05e4e6dd..3e66bd101c9 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -237,7 +237,8 @@ build_section_addr_info_from_section_table (const struct target_section *start,
sap->other[oidx].addr = stp->addr;
sap->other[oidx].name
= xstrdup (bfd_section_name (stp->bfd, stp->the_bfd_section));
- sap->other[oidx].sectindex = stp->the_bfd_section->index;
+ sap->other[oidx].sectindex
+ = gdb_bfd_section_index (stp->bfd, stp->the_bfd_section);
oidx++;
}
}
@@ -262,7 +263,7 @@ build_section_addr_info_from_bfd (bfd *abfd)
{
sap->other[i].addr = bfd_get_section_vma (abfd, sec);
sap->other[i].name = xstrdup (bfd_get_section_name (abfd, sec));
- sap->other[i].sectindex = sec->index;
+ sap->other[i].sectindex = gdb_bfd_section_index (abfd, sec);
i++;
}
@@ -389,7 +390,7 @@ place_section (bfd *abfd, asection *sect, void *obj)
return;
/* If the user specified an offset, honor it. */
- if (offsets[sect->index] != 0)
+ if (offsets[gdb_bfd_section_index (abfd, sect)] != 0)
return;
/* Otherwise, let's try to find a place for the section. */
@@ -433,7 +434,7 @@ place_section (bfd *abfd, asection *sect, void *obj)
}
while (!done);
- offsets[sect->index] = start_addr;
+ offsets[gdb_bfd_section_index (abfd, sect)] = start_addr;
arg->lowest = start_addr + bfd_get_section_size (sect);
}