X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf32-pru.c;h=dcf4adfa867ea467ddad9e4927994ecc55371de1;hb=bbde7025e0d5629e309c15af5a07bac272e21b07;hp=0b9e7dc82b205e1443ac6e4800ce11735aadb2b4;hpb=493ffac5aad8c39215702435c2506fd4d3077191;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-pru.c b/bfd/elf32-pru.c index 0b9e7dc82b..dcf4adfa86 100644 --- a/bfd/elf32-pru.c +++ b/bfd/elf32-pru.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for TI PRU. - Copyright (C) 2014-2018 Free Software Foundation, Inc. + Copyright (C) 2014-2019 Free Software Foundation, Inc. Contributed by Dimitar Dimitrov Based on elf32-nios2.c @@ -32,6 +32,9 @@ #include "opcode/pru.h" #include "libiberty.h" +/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1. */ +#define OCTETS_PER_BYTE(ABFD, SEC) 1 + #define SWAP_VALS(A,B) \ do { \ (A) ^= (B); \ @@ -421,7 +424,7 @@ pru_elf32_info_to_howto (bfd *abfd, arelent *cache_ptr, bfd_set_error (bfd_error_bad_value); return FALSE; } - + cache_ptr->howto = lookup_howto (r_type); return cache_ptr->howto != NULL; } @@ -537,7 +540,7 @@ pru_elf32_do_ldi32_relocate (bfd *abfd, reloc_howto_type *howto, bfd_vma symbol_value, bfd_vma addend) { bfd_signed_vma relocation; - bfd_size_type octets = offset * bfd_octets_per_byte (abfd); + bfd_size_type octets = offset * OCTETS_PER_BYTE (abfd, input_section); bfd_byte *location; unsigned long in1, in2; @@ -557,7 +560,7 @@ pru_elf32_do_ldi32_relocate (bfd *abfd, reloc_howto_type *howto, BFD_ASSERT (!howto->pc_relative); /* A hacked-up version of _bfd_relocate_contents() follows. */ - location = data + offset * bfd_octets_per_byte (abfd); + location = data + octets; BFD_ASSERT (!howto->pc_relative); @@ -905,7 +908,7 @@ pru_elf32_relocate_section (bfd *output_bfd, symtab_hdr->sh_link, sym->st_name); if (name == NULL || *name == '\0') - name = bfd_section_name (input_bfd, sec); + name = bfd_section_name (sec); } switch (r)