summaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
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
commitd646061f47345a5007a671c810b73eecc60960dd (patch)
tree9e8476cb774ae6f0f7e4e1489cf9352be4315934 /gdb/dbxread.c
parent2a13f9bcb4aac7956a16fb12f2557453aa129ae7 (diff)
downloadbinutils-gdb-d646061f47345a5007a671c810b73eecc60960dd.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.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c7
1 files changed, 6 insertions, 1 deletions
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++)
{