aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorThiemo Seufer <ths@networkno.de>2007-04-28 22:31:45 +0000
committerThiemo Seufer <ths@networkno.de>2007-04-28 22:31:45 +0000
commit9ddf830930edc617edef434411cd68d44ed46962 (patch)
tree650c889760c2de683e4ce78ec65a276188431446 /bfd/elfxx-mips.c
parent02ffd3e486f00ec80d6fdd4395045f02ee8569bb (diff)
downloadgdb-9ddf830930edc617edef434411cd68d44ed46962.zip
gdb-9ddf830930edc617edef434411cd68d44ed46962.tar.gz
gdb-9ddf830930edc617edef434411cd68d44ed46962.tar.bz2
* elfxx-mips.c (mips_elf_create_dynamic_relocation): Don't access
memory which we might not own.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 5b93d1b..d01b3e9 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. */