2009-04-30 Paul Pluzhnikov <ppluzhnikov@google.com>
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 30 Apr 2009 21:59:03 +0000 (21:59 +0000)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Thu, 30 Apr 2009 21:59:03 +0000 (21:59 +0000)
* elfread.c (elf_symtab_read): Don't assume .data and .rodata
are present.

gdb/ChangeLog
gdb/elfread.c

index 2d1fdf6e5fe459e8b86d6a60673631c4f9155ecf..c8e4137f913dd527b1a363479735480b9cc3c73e 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-30  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * elfread.c (elf_symtab_read): Don't assume .data and .rodata
+       are present.
+       
 2009-04-30  Hui Zhu  <teawater@gmail.com>
             Michael Snyder  <msnyder@vmware.com>
 
index ff220a25b6a71f3e5d916474da9c3cb12308663d..6e79d4abbd0c92abd16317f1cb43c0d6f0c08357 100644 (file)
@@ -427,10 +427,11 @@ elf_symtab_read (struct objfile *objfile, int type,
                          int max_index;
                          size_t size;
 
-                         max_index 
-                           = max (SECT_OFF_BSS (objfile),
-                                  max (SECT_OFF_DATA (objfile),
-                                       SECT_OFF_RODATA (objfile)));
+                         max_index = SECT_OFF_BSS (objfile);
+                         if (objfile->sect_index_data > max_index)
+                           max_index = objfile->sect_index_data;
+                         if (objfile->sect_index_rodata > max_index)
+                           max_index = objfile->sect_index_rodata;
 
                          /* max_index is the largest index we'll
                             use into this array, so we must