summaryrefslogtreecommitdiff
path: root/bfd/coff-mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/coff-mips.c')
-rw-r--r--bfd/coff-mips.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index 9ef19852df..ca3376d9fa 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -473,6 +473,7 @@ mips_refhi_reloc (abfd,
{
bfd_reloc_status_type ret;
bfd_vma relocation;
+ bfd_size_type sz;
struct mips_hi *n;
/* If we're relocating, and this an external symbol, we don't want
@@ -499,7 +500,8 @@ mips_refhi_reloc (abfd,
relocation += symbol->section->output_offset;
relocation += reloc_entry->addend;
- if (reloc_entry->address > input_section->_cooked_size)
+ sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+ if (reloc_entry->address > sz)
return bfd_reloc_outofrange;
/* Save the information, and let REFLO do the actual relocation. */
@@ -608,6 +610,7 @@ mips_gprel_reloc (abfd,
bfd_boolean relocatable;
bfd_vma gp;
bfd_vma relocation;
+ bfd_size_type sz;
unsigned long val;
unsigned long insn;
@@ -697,7 +700,8 @@ mips_gprel_reloc (abfd,
relocation += symbol->section->output_section->vma;
relocation += symbol->section->output_offset;
- if (reloc_entry->address > input_section->_cooked_size)
+ sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+ if (reloc_entry->address > sz)
return bfd_reloc_outofrange;
insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);