This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] dwarf2read.c (dwarf2_read_index): Don't use index if empty.
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Fri, 27 Apr 2012 21:36:50 -0700 (PDT)
- Subject: [commit] dwarf2read.c (dwarf2_read_index): Don't use index if empty.
Hi.
I was getting a failure in amd64-i386-address.exp with the index
generated by gold. There are no symbols which messes up the hash
calculation.
Committed.
2012-04-27 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf2_read_index): Don't use index if empty.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.641
diff -u -p -r1.641 dwarf2read.c
--- dwarf2read.c 27 Apr 2012 18:55:19 -0000 1.641
+++ dwarf2read.c 28 Apr 2012 04:32:20 -0000
@@ -2192,6 +2192,10 @@ dwarf2_read_index (struct objfile *objfi
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;