From a4c8257b03066fd493a6aea443ca7b1717c1df22 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Mon, 7 Aug 2000 15:02:48 +0000 Subject: 2000-08-07 Elena Zannoni * 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. --- gdb/symtab.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/symtab.h') diff --git a/gdb/symtab.h b/gdb/symtab.h index 101759f..55db0f8 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -829,7 +829,9 @@ struct section_offsets CORE_ADDR offsets[1]; /* As many as needed. */ }; -#define ANOFFSET(secoff, whichone) (secoff->offsets[whichone]) +#define ANOFFSET(secoff, whichone) \ + ((whichone == -1) ? \ + (internal_error ("Section index is uninitialized"), -1) : secoff->offsets[whichone]) /* The maximum possible size of a section_offsets table. */ -- cgit v1.1