summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2003-09-13 00:17:36 +0000
committerJim Blandy <jimb@codesourcery.com>2003-09-13 00:17:36 +0000
commitc18372891a51cd8085ce937461b80abeeb0068d5 (patch)
tree43fb17389d1cb4da91c4ed83ba7d171c733e5948
parent9d96e6a993190040d27658b40f70b5154c9a13cd (diff)
downloadgdb-c18372891a51cd8085ce937461b80abeeb0068d5.tar.gz
* dbxread.c (read_dbx_symtab): Don't report an internal error if
the file has no .data, .bss, or .rodata sections. Instead wait until we see a variable alleged to live in one of those sections.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/dbxread.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2f470b8ddbe..48e36c9c0c0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2003-09-12 Jim Blandy <jimb@redhat.com>
+ * dbxread.c (read_dbx_symtab): Don't report an internal error if
+ the file has no .data, .bss, or .rodata sections. Instead wait
+ until we see a variable alleged to live in one of those sections.
+
* dbxread.c (read_dbx_symtab): If we have no .data section and no
.bss section, presume that any variables we find live in the
.rodata section.
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 8bfaf1c8e91..d58fc5b2ebe 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1382,7 +1382,12 @@ read_dbx_symtab (struct objfile *objfile)
data_sect_index = SECT_OFF_BSS (objfile);
if (data_sect_index == -1)
data_sect_index = SECT_OFF_RODATA (objfile);
- gdb_assert (data_sect_index != -1);
+
+ /* If data_sect_index is still -1, that's okay. It's perfectly fine
+ for the file to have no .data, no .bss, and no .text at all, if
+ it also has no global or static variables. If it does, we will
+ get an internal error from an ANOFFSET macro below when we try to
+ use data_sect_index. */
for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
{