aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-08-07 15:02:48 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-08-07 15:02:48 +0000
commita4c8257b03066fd493a6aea443ca7b1717c1df22 (patch)
tree7b90a808bc1bee67ca150870f1b8695df6991b3c /gdb/elfread.c
parent279ddab43fb1e29a4ffb63e9e7a34f89b2ac2a31 (diff)
downloadgdb-a4c8257b03066fd493a6aea443ca7b1717c1df22.zip
gdb-a4c8257b03066fd493a6aea443ca7b1717c1df22.tar.gz
gdb-a4c8257b03066fd493a6aea443ca7b1717c1df22.tar.bz2
2000-08-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_BSS): Don't detect invalid sect_index_bss here, let the users of the macro do it. * symtab.h (ANOFFSET): Detect here if the section index is not initialized. * xcoffread.c (find_targ_sec): Don't treat .bss as special, because some objfiles may not have that section at all. * coffread.c (cs_to_section): Ditto. * elfread.c (elf_symtab_read): Detect an uninitialized index value. (elfstab_offset_sections): The macro ANOFFSET cannot be used as an lvalue anymore. * remote.c (get_offsets, remote_cisco_objfile_relocate): Don't use ANOFFSET as an lvalue. * objfiles.c (objfile_relocate, objfile_relocate): Don't use ANOFFSET as an lvalue. * symfile.c (default_symfile_offsets): Don't use ANOFFSET as an lvalue.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 3de6b5e..b964552 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -474,11 +474,16 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
(char *) filesym->name;
}
}
- if (sectinfo->sections[index] != 0)
- {
- complain (&section_info_dup_complaint,
- sectinfo->filename);
+ if (index != -1)
+ {
+ if (sectinfo->sections[index] != 0)
+ {
+ complain (&section_info_dup_complaint,
+ sectinfo->filename);
+ }
}
+ else
+ internal_error ("Section index uninitialized.");
/* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
/* Relocate non-absolute symbols by the section offset. */
@@ -486,7 +491,10 @@ elf_symtab_read (struct objfile *objfile, int dynamic)
{
symaddr += offset;
}
- sectinfo->sections[index] = symaddr;
+ if (index != -1)
+ sectinfo->sections[index] = symaddr;
+ else
+ internal_error ("Section index uninitialized.");
/* The special local symbols don't go in the
minimal symbol table, so ignore this one. */
continue;
@@ -790,7 +798,7 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
pst->section_offsets = (struct section_offsets *)
obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS);
for (i = 0; i < SECT_OFF_MAX; i++)
- ANOFFSET (pst->section_offsets, i) = maybe->sections[i];
+ (pst->section_offsets)->offsets[i] = maybe->sections[i];
return;
}