From 25c2f6abe046d0ce97853334221bda452101df81 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Thu, 30 Apr 2009 21:59:03 +0000 Subject: [PATCH] 2009-04-30 Paul Pluzhnikov * elfread.c (elf_symtab_read): Don't assume .data and .rodata are present. --- gdb/ChangeLog | 5 +++++ gdb/elfread.c | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2d1fdf6e5fe..c8e4137f913 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-04-30 Paul Pluzhnikov + + * elfread.c (elf_symtab_read): Don't assume .data and .rodata + are present. + 2009-04-30 Hui Zhu Michael Snyder diff --git a/gdb/elfread.c b/gdb/elfread.c index ff220a25b6a..6e79d4abbd0 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 -- 2.30.2