diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2016-04-05 17:23:24 +0200 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2016-04-05 17:24:18 +0200 |
commit | 1e5885b72e20ef874f526e77a4946b2655e6d3c3 (patch) | |
tree | 806ae7b84fea66774e628f9668556dd56e62baf0 /bfd | |
parent | b3aee8396f02744c0b688d0ee75c585534b7e8c4 (diff) | |
download | gdb-1e5885b72e20ef874f526e77a4946b2655e6d3c3.zip gdb-1e5885b72e20ef874f526e77a4946b2655e6d3c3.tar.gz gdb-1e5885b72e20ef874f526e77a4946b2655e6d3c3.tar.bz2 |
[ARC] PLT content endianess awareness.
bfd/
2016-04-05 Cupertino Miranda <cmiranda@synopsys.com>
* elf32-arc.c (plt_do_relocs_for_symbol): Changed.
(relocate_plt_for_entry): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arc.c | 31 |
2 files changed, 30 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d8a4fef..4fd4b4c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2016-04-05 Cupertino Miranda <cmiranda@synopsys.com> + * elf32-arc.c (plt_do_relocs_for_symbol): Changed. + (relocate_plt_for_entry): Likewise. + +2016-04-05 Cupertino Miranda <cmiranda@synopsys.com> + * elf32-arc.c (elf_arc_check_relocs): Changed 2016-04-05 Cupertino Miranda <cmiranda@synopsys.com> diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 0a4f480..323f65d 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1960,7 +1960,7 @@ plt_do_relocs_for_symbol (bfd *abfd, /* TODO: being ME is not a property of the relocation but of the section of which is applying the relocation. */ - if (IS_MIDDLE_ENDIAN (reloc->symbol) || bfd_big_endian (abfd)) + if (IS_MIDDLE_ENDIAN (reloc->symbol) && !bfd_big_endian (abfd)) { relocation = ((relocation & 0xffff0000) >> 16) | @@ -2004,9 +2004,19 @@ GOT_ENTRY_OFFSET = 0x%x, GOT_ENTRY_VMA = 0x%x, for symbol %s\n", + got_offset, h->root.root.string); - memcpy (htab->splt->contents + h->plt.offset, - plt_data->elem, - plt_data->elem_size); + + { + bfd_vma i = 0; + uint16_t *ptr = (uint16_t *) plt_data->elem; + for (i = 0; i < plt_data->elem_size/2; i++) + { + uint16_t data = ptr[i]; + bfd_put_16 (output_bfd, + (bfd_vma) data, + htab->splt->contents + h->plt.offset + (i*2)); + } + } + plt_do_relocs_for_symbol (output_bfd, htab, plt_data->elem_relocs, h->plt.offset, @@ -2044,8 +2054,17 @@ relocate_plt_for_entry (bfd *abfd, struct plt_version_t *plt_data = arc_get_plt_version (info); struct elf_link_hash_table *htab = elf_hash_table (info); - memcpy (htab->splt->contents, plt_data->entry, - plt_data->entry_size); + { + bfd_vma i = 0; + uint16_t *ptr = (uint16_t *) plt_data->entry; + for (i = 0; i < plt_data->entry_size/2; i++) + { + uint16_t data = ptr[i]; + bfd_put_16 (abfd, + (bfd_vma) data, + htab->splt->contents + (i*2)); + } + } PLT_DO_RELOCS_FOR_ENTRY (abfd, htab, plt_data->entry_relocs); } |