aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/coff-i386.c')
-rw-r--r--bfd/coff-i386.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c
index f28eb8a..99f6079 100644
--- a/bfd/coff-i386.c
+++ b/bfd/coff-i386.c
@@ -41,6 +41,9 @@
#include "libcoff.h"
+/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1. */
+#define OCTETS_PER_BYTE(ABFD, SEC) 1
+
static reloc_howto_type *coff_i386_rtype_to_howto
(bfd *, asection *, struct internal_reloc *,
struct coff_link_hash_entry *, struct internal_syment *,
@@ -67,7 +70,7 @@ coff_i386_reloc (bfd *abfd,
arelent *reloc_entry,
asymbol *symbol,
void * data,
- asection *input_section ATTRIBUTE_UNUSED,
+ asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
@@ -142,11 +145,11 @@ coff_i386_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, NULL)))
+ if (!bfd_reloc_offset_in_range (howto, abfd, input_section, octets))
return bfd_reloc_outofrange;
switch (howto->size)