diff options
author | Alan Modra <amodra@bigpond.net.au> | 2004-06-29 13:46:34 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2004-06-29 13:46:34 +0000 |
commit | 453105e85437cd294c10c1c61caeefb5432d940d (patch) | |
tree | 8773a61cdc97d607efac222f7552bd6abc111b7c /bfd/elf32-mips.c | |
parent | 69f2a6fc7a7dc00caa0dbdf88df735c86b38409e (diff) | |
download | gdb-453105e85437cd294c10c1c61caeefb5432d940d.tar.gz |
* bfd-in.h (bfd_get_section_limit): Define.
* reloc.c (bfd_perform_relocation, bfd_install_relocation)
(_bfd_final_link_relocate): Use bfd_get_section_limit.
* aout-tic30.c (tic30_aout_final_link_relocate): Likewise.
* coff-arm.c (coff_arm_relocate_section): Likewise.
* coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): Likewise.
* cpu-ns32k.c (do_ns32k_reloc): Likewise.
(bfd_ns32k_final_link_relocate): Likewise.
* elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): Likwise.
* elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): Likewise.
* elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc)
(i860_howto_highadj_reloc, i860_howto_splitn_reloc): Likewise.
* elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc)
(m32r_elf_generic_reloc, m32r_elf_relocate_section): Likewise.
* elf32-m68hc1x.c (m68hc11_elf_special_reloc): Likewise.
* elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
* elf32-or32.c (or32_elf_consth_reloc): Likewise.
* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Likewise.
* elf32-s390.c (s390_elf_ldisp_reloc): Likewise.
* elf32-sh.c (sh_elf_reloc_loop): Likewise.
* elf32-sparc.c (sparc_elf_wdisp16_reloc): Likewise.
(sparc_elf_hix22_reloc, sparc_elf_lox10_reloc): Likwise.
* elf32-v850.c (v850_elf_reloc): Likewise.
* elf32-xstormy16.c (xstormy16_elf_24_reloc): Likewise.
* elf32-xtensa.c (bfd_elf_xtensa_reloc): Likewise.
* elf64-alpha.c (elf64_alpha_reloc_gpdisp): Likewise.
* elf64-mips.c (mips_elf64_gprel32_reloc)
(mips16_gprel_reloc): Likewise.
* elf64-mmix.c (mmix_elf_reloc): Likewise.
* elf64-s390.c (s390_elf_ldisp_reloc): Likewise.
* elf64-sparc.c (init_insn_reloc): Likewise.
* elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
* elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp)
(_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_lo16_reloc)
(_bfd_mips_elf_generic_reloc): Likewise.
* bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/elf32-mips.c')
-rw-r--r-- | bfd/elf32-mips.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index 188fa1c0c3f..9774215d018 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -824,7 +824,6 @@ gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry, { bfd_vma relocation; bfd_vma val; - bfd_size_type sz; if (bfd_is_com_section (symbol->section)) relocation = 0; @@ -834,8 +833,7 @@ gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry, relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; - sz = input_section->rawsize ? input_section->rawsize : input_section->size; - if (reloc_entry->address > sz) + if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) return bfd_reloc_outofrange; /* Set val to the offset into the section or symbol. */ @@ -943,7 +941,6 @@ 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, we don't want to change anything. */ @@ -968,8 +965,7 @@ mips16_gprel_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, if (ret != bfd_reloc_ok) return ret; - sz = input_section->rawsize ? input_section->rawsize : input_section->size; - if (reloc_entry->address > sz) + if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) return bfd_reloc_outofrange; if (bfd_is_com_section (symbol->section)) |