X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-hppa.c;h=770706014f093bd552c67844277ef6294824d2e8;hb=4fbb74a6055f7d48f09c44064073d3b1e99c6642;hp=20b16beb674614556b3d5fbd0b003b0daa1bfb1e;hpb=1650c4ff500bc54eea33d31ae9396434a3e13733;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 20b16beb67..770706014f 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -1,6 +1,7 @@ /* BFD back-end for HP PA-RISC ELF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Free Software Foundation, Inc. Original code by Center for Software Science @@ -2976,15 +2977,20 @@ elf32_hppa_size_stubs /* It's a local symbol. */ Elf_Internal_Sym *sym; Elf_Internal_Shdr *hdr; + unsigned int shndx; sym = local_syms + r_indx; - hdr = elf_elfsections (input_bfd)[sym->st_shndx]; - sym_sec = hdr->bfd_section; if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) sym_value = sym->st_value; - destination = (sym_value + irela->r_addend - + sym_sec->output_offset - + sym_sec->output_section->vma); + shndx = sym->st_shndx; + if (shndx < elf_numsections (input_bfd)) + { + hdr = elf_elfsections (input_bfd)[shndx]; + sym_sec = hdr->bfd_section; + destination = (sym_value + irela->r_addend + + sym_sec->output_offset + + sym_sec->output_section->vma); + } } else {