aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-02-17 20:54:52 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-02-17 20:54:52 +0000
commit012836ea499d870d8d52a6b4dea3c9b3e8eb85c9 (patch)
tree0139e19168b55c1ce274570d44333be3c93afd15 /gdb/symfile.c
parentd182d0578f4fbf243c8a6b82a67388282f5e3c36 (diff)
downloadgdb-012836ea499d870d8d52a6b4dea3c9b3e8eb85c9.zip
gdb-012836ea499d870d8d52a6b4dea3c9b3e8eb85c9.tar.gz
gdb-012836ea499d870d8d52a6b4dea3c9b3e8eb85c9.tar.bz2
gdb/
* symfile.c (build_section_addr_info_from_objfile): Include sections only if they are SEC_ALLOC or SEC_LOAD.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index ca4d788..6f455a2 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -371,16 +371,16 @@ build_section_addr_info_from_objfile (const struct objfile *objfile)
mask = ((CORE_ADDR) 1 << addr_bit) - 1;
sap = alloc_section_addr_info (objfile->num_sections);
- for (i = 0, sec = objfile->obfd->sections;
- i < objfile->num_sections;
- i++, sec = sec->next)
- {
- gdb_assert (sec != NULL);
- sap->other[i].addr = (bfd_get_section_vma (objfile->obfd, sec)
- + objfile->section_offsets->offsets[i]) & mask;
- sap->other[i].name = xstrdup (bfd_get_section_name (objfile->obfd, sec));
- sap->other[i].sectindex = sec->index;
- }
+ for (i = 0, sec = objfile->obfd->sections; sec != NULL; sec = sec->next)
+ if (bfd_get_section_flags (objfile->obfd, sec) & (SEC_ALLOC | SEC_LOAD))
+ {
+ sap->other[i].addr = (bfd_get_section_vma (objfile->obfd, sec)
+ + objfile->section_offsets->offsets[i]) & mask;
+ sap->other[i].name = xstrdup (bfd_get_section_name (objfile->obfd,
+ sec));
+ sap->other[i].sectindex = sec->index;
+ i++;
+ }
return sap;
}