X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fcoff-arm.c;h=84477eaa8fee51c159caab5dfa7ea154e83f5a4e;hb=f5a7c406b1975cde626efed526960f2cf1bdaceb;hp=cbc5257e9f3e951a5ed46aa92336426ef0aee07c;hpb=fd3619828e94a24a92cddec42cbc0ab33352eeb4;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index cbc5257e9f..84477eaa8f 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for ARM COFF files. - Copyright (C) 1990-2019 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -24,6 +24,8 @@ #include "libbfd.h" #include "coff/arm.h" #include "coff/internal.h" +#include "cpu-arm.h" +#include "coff-arm.h" #ifdef COFF_WITH_PE #include "coff/pe.h" @@ -31,6 +33,9 @@ #include "libcoff.h" +/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1. */ +#define OCTETS_PER_BYTE(ABFD, SEC) 1 + /* Macros for manipulation the bits in the flags field of the coff data structure. */ #define APCS_26_FLAG(abfd) \ @@ -94,7 +99,7 @@ coff_arm_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol ATTRIBUTE_UNUSED, void * data, - asection *input_section ATTRIBUTE_UNUSED, + asection *input_section, bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED) { @@ -112,11 +117,11 @@ coff_arm_reloc (bfd *abfd, if (diff != 0) { reloc_howto_type *howto = reloc_entry->howto; - unsigned char *addr = (unsigned char *) data + reloc_entry->address; + bfd_size_type octets = (reloc_entry->address + * OCTETS_PER_BYTE (abfd, input_section)); + unsigned char *addr = (unsigned char *) data + octets; - if (! bfd_reloc_offset_in_range (howto, abfd, input_section, - reloc_entry->address - * bfd_octets_per_byte (abfd))) + if (!bfd_reloc_offset_in_range (howto, abfd, input_section, octets)) return bfd_reloc_outofrange; switch (howto->size)