diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2009-04-30 21:59:03 +0000 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2009-04-30 21:59:03 +0000 |
commit | 25c2f6abe046d0ce97853334221bda452101df81 (patch) | |
tree | 05e9c260392085b164c53611a9fabcc8fbb4e9a8 | |
parent | 3526b6802eb19481fc9143f53246640e77e3198a (diff) | |
download | gdb-25c2f6abe046d0ce97853334221bda452101df81.zip gdb-25c2f6abe046d0ce97853334221bda452101df81.tar.gz gdb-25c2f6abe046d0ce97853334221bda452101df81.tar.bz2 |
2009-04-30 Paul Pluzhnikov <ppluzhnikov@google.com>
* elfread.c (elf_symtab_read): Don't assume .data and .rodata
are present.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/elfread.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2d1fdf6..c8e4137 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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> diff --git a/gdb/elfread.c b/gdb/elfread.c index ff220a2..6e79d4a 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -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 |