bfd_reloc_status_type status;
/* Sanity check the address (offset in section). */
- if (offset > bfd_get_section_limit (abfd, input_section))
+ bfd_vma octet = offset * bfd_octets_per_byte (abfd, input_section);
+ if (!bfd_reloc_offset_in_range (howto, abfd, input_section, octet))
return bfd_reloc_outofrange;
relocation = symbol_value + addend;
static struct nds32_hi20 *nds32_hi20_list;
static bfd_reloc_status_type
-nds32_elf_hi20_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+nds32_elf_hi20_reloc (bfd *abfd,
arelent *reloc_entry,
asymbol *symbol,
void *data,
}
/* Sanity check the address (offset in section). */
- if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
+ bfd_vma octet = (reloc_entry->address
+ * bfd_octets_per_byte (abfd, input_section));
+ if (!bfd_reloc_offset_in_range (reloc_entry->howto,
+ abfd, input_section, octet))
return bfd_reloc_outofrange;
ret = bfd_reloc_ok;
a section relative addend which is wrong. */
/* Sanity check the address (offset in section). */
- if (reloc_entry->address > bfd_get_section_limit (input_bfd, input_section))
+ bfd_vma octet = (reloc_entry->address
+ * bfd_octets_per_byte (input_bfd, input_section));
+ if (!bfd_reloc_offset_in_range (reloc_entry->howto, input_bfd, input_section,
+ octet))
return bfd_reloc_outofrange;
ret = bfd_reloc_ok;
bfd_vma relocation;
/* Sanity check the address. */
- if (address > bfd_get_section_limit (input_bfd, input_section))
+ bfd_vma octet = address * bfd_octets_per_byte (input_bfd, input_section);
+ if (!bfd_reloc_offset_in_range (howto, input_bfd, input_section, octet))
return bfd_reloc_outofrange;
/* This function assumes that we are dealing with a basic relocation