* dwarf2read.c (dwarf2_read_index): Don't use index if symbol table
authorDoug Evans <dje@google.com>
Sat, 28 Apr 2012 04:38:14 +0000 (04:38 +0000)
committerDoug Evans <dje@google.com>
Sat, 28 Apr 2012 04:38:14 +0000 (04:38 +0000)
is empty.

gdb/ChangeLog
gdb/dwarf2read.c

index b047f3505b1e28425db7728c44f34cf19e0b62ce..e364e13930f3ea04e0e9130f1aeaddd6c4ad09c0 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-27  Doug Evans  <dje@google.com>
+
+       * dwarf2read.c (dwarf2_read_index): Don't use index if symbol table
+       is empty.
+
 2012-04-27  Sergio Durigan Junior  <sergiodj@redhat.com>
            Tom Tromey  <tromey@redhat.com>
 
index 7ae3b8616cd5a079fd6429acd4ae91d9b8e9c78a..a5917140ec989ecfd876f85f508579ad9cfadacb 100644 (file)
@@ -2192,6 +2192,10 @@ dwarf2_read_index (struct objfile *objfile)
 
   map->constant_pool = addr + MAYBE_SWAP (metadata[i]);
 
+  /* Don't use the index if it's empty.  */
+  if (map->symbol_table_slots == 0)
+    return 0;
+
   if (!create_cus_from_index (objfile, cu_list, cu_list_elements))
     return 0;