bfd_vma relocation;
bfd_reloc_status_type flag;
bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
- bfd_size_type sz;
bfd_vma output_base = 0;
reloc_howto_type *howto = reloc_entry->howto;
asection *reloc_target_output_section;
}
/* Is the address of the relocation really within the section? */
- sz = input_section->rawsize ? input_section->rawsize : input_section->size;
- if (reloc_entry->address > sz / bfd_octets_per_byte (abfd))
+ if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
return bfd_reloc_outofrange;
/* Work out which section the relocation is targeted at and the
}
/* Sanity check the address. */
- if (rel->r_offset >= input_section->size
+ if (rel->r_offset >= bfd_get_section_limit (input_bfd, input_section)
&& ELF32_R_TYPE (rel->r_info) != R_XTENSA_NONE)
{
bfd_set_error (bfd_error_bad_value);
/* Clear the removed bytes. */
if ((bfd_size_type) (num * 8) < section_size)
- {
- memset (&contents[num * 8], 0, section_size - num * 8);
- sxtlit->size = num * 8;
- }
+ memset (&contents[num * 8], 0, section_size - num * 8);
if (! bfd_set_section_contents (output_bfd, sxtlit, contents, 0,
section_size))