* bfd-in.h (bfd_get_section_limit): Define.
[deliverable/binutils-gdb.git] / bfd / elf32-xtensa.c
index 495c275027d5d5e91de4548353bd965182b893d4..438e17b05edf732d3e9297889e605589578afb11 100644 (file)
@@ -1650,7 +1650,6 @@ bfd_elf_xtensa_reloc (abfd, reloc_entry, symbol, data, input_section,
   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;
@@ -1675,8 +1674,7 @@ bfd_elf_xtensa_reloc (abfd, reloc_entry, symbol, data, input_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
This page took 0.026158 seconds and 4 git commands to generate.