aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/elfread.c2
-rw-r--r--gdb/mipsread.c3
3 files changed, 12 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 83ab46b..5e3bce1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2008-03-12 Alan Modra <amodra@bigpond.net.au>
+
+ PR 5900
+ * elfread.c (elf_symtab_read): Make shndx an unsigned int.
+ * mipsread.c: Include elf/internal.h.
+ (read_alphacoff_dynamic_symtab): Map external reserved sym_shndx
+ to internal range.
+
2008-03-11 Markus Deuling <deuling@de.ibm.com>
* win32-nat.c (do_win32_fetch_inferior_registers): Use get_regcache_arch
diff --git a/gdb/elfread.c b/gdb/elfread.c
index c0dd7fb..5a201c9 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -333,7 +333,7 @@ elf_symtab_read (struct objfile *objfile, int type,
NOTE: uweigand-20071112: Synthetic symbols do not
have an ELF-private part, so do not touch those. */
- unsigned short shndx = type == ST_SYNTHETIC ? 0 :
+ unsigned int shndx = type == ST_SYNTHETIC ? 0 :
((elf_symbol_type *) sym)->internal_elf_sym.st_shndx;
switch (shndx)
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index 4f24462..fdd8634 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -39,6 +39,7 @@
#include "libcoff.h" /* Private BFD COFF information. */
#include "libecoff.h" /* Private BFD ECOFF information. */
#include "elf/common.h"
+#include "elf/internal.h"
#include "elf/mips.h"
static void
@@ -293,6 +294,8 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets,
sym_value = bfd_h_get_64 (abfd, (bfd_byte *) x_symp->st_value);
sym_info = bfd_h_get_8 (abfd, (bfd_byte *) x_symp->st_info);
sym_shndx = bfd_h_get_16 (abfd, (bfd_byte *) x_symp->st_shndx);
+ if (sym_shndx >= (SHN_LORESERVE & 0xffff))
+ sym_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff);
isglobal = (ELF_ST_BIND (sym_info) == STB_GLOBAL);
if (sym_shndx == SHN_UNDEF)