From 9ddf830930edc617edef434411cd68d44ed46962 Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Sat, 28 Apr 2007 22:31:45 +0000 Subject: [PATCH] * elfxx-mips.c (mips_elf_create_dynamic_relocation): Don't access memory which we might not own. --- bfd/ChangeLog | 5 +++++ bfd/elfxx-mips.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fb5af0bc686..17109feb09f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2007-04-28 Sergey Rogozhkin + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Don't access + memory which we might not own. + 2007-04-27 Bob Wilson * elf32-xtensa.c (elf_xtensa_make_sym_local): Restore deleted function. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 5b93d1be2cf..d01b3e980cf 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -4786,10 +4786,13 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd, outrel[0].r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel[0].r_offset); - outrel[1].r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); - outrel[2].r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + if (ABI_64_P (output_bfd)) + { + outrel[1].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[1].r_offset); + outrel[2].r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, rel[2].r_offset); + } if (outrel[0].r_offset == MINUS_ONE) /* The relocation field has been deleted. */ -- 2.30.2