2009-04-30 Paul Pluzhnikov <ppluzhnikov@google.com>

* elfread.c (elf_symtab_read): Don't assume .data and .rodata
	are present.
This commit is contained in:
Paul Pluzhnikov 2009-04-30 21:59:03 +00:00
parent 3526b6802e
commit 25c2f6abe0
2 changed files with 10 additions and 4 deletions

View 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>

View 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