correct ft32 reloc range test
[deliverable/binutils-gdb.git] / bfd / coff-m88k.c
index b9718658ce76ba479fcb2f07386ceeb5c5f0d0d1..93a2d48729a25296bb4542c07d3267584428880b 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for Motorola 88000 COFF "Binary Compatibility Standard" files.
-   Copyright (C) 1990-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-2018 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -72,10 +72,17 @@ m88k_special_reloc (bfd *abfd,
        {
          bfd_vma output_base = 0;
          bfd_vma addr = reloc_entry->address;
-         bfd_vma x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
+         bfd_vma x;
          asection *reloc_target_output_section;
          long relocation = 0;
 
+         if (! bfd_reloc_offset_in_range (howto, abfd, input_section,
+                                          reloc_entry->address
+                                          * bfd_octets_per_byte (abfd)))
+           return bfd_reloc_outofrange;
+
+         x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
+
          /* Work out which section the relocation is targeted at and the
             initial relocation command value.  */
 
This page took 0.023693 seconds and 4 git commands to generate.