diff options
Diffstat (limited to 'bfd/elf64-mips.c')
-rw-r--r-- | bfd/elf64-mips.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index fa3b494..7434442 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -1,5 +1,5 @@ /* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. @@ -1588,6 +1588,7 @@ mips_elf64_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, bfd_vma gp; bfd_vma relocation; bfd_vma val; + bfd_size_type sz; /* If we're relocating, and this is an external symbol, we don't want to change anything. */ @@ -1621,7 +1622,8 @@ mips_elf64_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, 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; /* Set val to the offset into the section or symbol. */ @@ -1712,6 +1714,7 @@ mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, unsigned short insn = 0; bfd_signed_vma val; bfd_vma relocation; + bfd_size_type sz; /* If we're relocating, and this is an external symbol with no addend, we don't want to change anything. */ @@ -1736,7 +1739,8 @@ mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, if (ret != bfd_reloc_ok) return ret; - 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; if (bfd_is_com_section (symbol->section)) @@ -1984,7 +1988,7 @@ mips_elf64_canonicalize_dynamic_reloc (bfd *abfd, arelent **storage, if (! (*slurp_relocs) (abfd, s, syms, TRUE)) return -1; - count = s->_raw_size / elf_section_data (s)->this_hdr.sh_entsize * 3; + count = s->size / elf_section_data (s)->this_hdr.sh_entsize * 3; p = s->relocation; for (i = 0; i < count; i++) *storage++ = p++; @@ -2210,7 +2214,7 @@ mips_elf64_slurp_reloc_table (bfd *abfd, asection *asect, case because relocations against this section may use the dynamic symbol table, and in that case bfd_section_from_shdr in elf.c does not update the RELOC_COUNT. */ - if (asect->_raw_size == 0) + if (asect->size == 0) return TRUE; rel_hdr = &d->this_hdr; @@ -2539,7 +2543,7 @@ static bfd_boolean elf64_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; - unsigned int raw_size; + unsigned int size; switch (note->descsz) { @@ -2555,14 +2559,14 @@ elf64_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) /* pr_reg */ offset = 112; - raw_size = 360; + size = 360; break; } /* Make a ".reg/999" section. */ return _bfd_elfcore_make_pseudosection (abfd, ".reg", - raw_size, note->descpos + offset); + size, note->descpos + offset); } static bfd_boolean |