X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=bfd%2Felf32-i860.c;h=010ac2e76196ff1fb678ff148aa3751262027990;hb=075154045b3a1c940a448846723be16e3c7e0930;hp=863d7aecbe1e8078df8e30a4f2a94ab18d983b37;hpb=950ad202a518f7deb8e4ef1b2a3b63e2e3d7450d;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c index 863d7aecbe..010ac2e761 100644 --- a/bfd/elf32-i860.c +++ b/bfd/elf32-i860.c @@ -38,7 +38,6 @@ i860_howto_pc26_reloc (bfd *abfd ATTRIBUTE_UNUSED, { bfd_vma insn; bfd_vma relocation; - bfd_size_type sz; bfd_byte *addr; if (output_bfd != NULL @@ -64,8 +63,7 @@ i860_howto_pc26_reloc (bfd *abfd ATTRIBUTE_UNUSED, relocation += symbol->section->output_offset; relocation += reloc_entry->addend; - 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; /* Adjust for PC-relative relocation. */ @@ -103,7 +101,6 @@ i860_howto_pc16_reloc (bfd *abfd, { bfd_vma insn; bfd_vma relocation; - bfd_size_type sz; bfd_byte *addr; if (output_bfd != NULL @@ -129,8 +126,7 @@ i860_howto_pc16_reloc (bfd *abfd, relocation += symbol->section->output_offset; relocation += reloc_entry->addend; - 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; /* Adjust for PC-relative relocation. */ @@ -169,7 +165,6 @@ i860_howto_highadj_reloc (bfd *abfd, { bfd_vma insn; bfd_vma relocation; - bfd_size_type sz; bfd_byte *addr; if (output_bfd != NULL @@ -196,8 +191,7 @@ i860_howto_highadj_reloc (bfd *abfd, relocation += reloc_entry->addend; relocation += 0x8000; - 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; addr = (bfd_byte *) data + reloc_entry->address; @@ -224,7 +218,6 @@ i860_howto_splitn_reloc (bfd *abfd, { bfd_vma insn; bfd_vma relocation; - bfd_size_type sz; bfd_byte *addr; if (output_bfd != NULL @@ -250,8 +243,7 @@ i860_howto_splitn_reloc (bfd *abfd, relocation += symbol->section->output_offset; relocation += reloc_entry->addend; - 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; addr = (bfd_byte *) data + reloc_entry->address;