diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2008-12-15 03:17:49 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2008-12-15 03:17:49 +0000 |
commit | 237bc7f0464985ca8b6bd8b62e0b6a34222b7dfe (patch) | |
tree | 48db7534d5c7be8a9e43ee006062b2ed8b909c64 | |
parent | 8101aae242f9b9cb8731cd4abc865e9f7fca887f (diff) | |
download | gdb-237bc7f0464985ca8b6bd8b62e0b6a34222b7dfe.zip gdb-237bc7f0464985ca8b6bd8b62e0b6a34222b7dfe.tar.gz gdb-237bc7f0464985ca8b6bd8b62e0b6a34222b7dfe.tar.bz2 |
* elf32-cris.c (elf_cris_copy_indirect_symbol): New function.
(elf_backend_copy_indirect_symbol): Define to above.
-rw-r--r-- | bfd/ChangeLog | 3 | ||||
-rw-r--r-- | bfd/elf32-cris.c | 31 |
2 files changed, 34 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ec121d1..0836a46 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ 2008-12-15 Hans-Peter Nilsson <hp@axis.com> + * elf32-cris.c (elf_cris_copy_indirect_symbol): New function. + (elf_backend_copy_indirect_symbol): Define to above. + * elf32-cris.c (struct elf_cris_pcrel_relocs_copied): New member r_type. Fix formatting. (cris_elf_relocate_section) <R_CRIS_8_PCREL, R_CRIS_16_PCREL> diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 8c9a79b..389798d 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -3012,6 +3012,35 @@ elf_cris_adjust_dynamic_symbol (info, h) return _bfd_elf_adjust_dynamic_copy (h, s); } +/* Adjust our "subclass" elements for an indirect symbol. */ + +static void +elf_cris_copy_indirect_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) +{ + struct elf_cris_link_hash_entry *edir, *eind; + + edir = (struct elf_cris_link_hash_entry *) dir; + eind = (struct elf_cris_link_hash_entry *) ind; + + BFD_ASSERT (edir->pcrel_relocs_copied == NULL); + BFD_ASSERT (edir->gotplt_offset == 0 || eind->gotplt_offset == 0); + +#define XMOVOPZ(F, OP, Z) edir->F OP eind->F; eind->F = Z +#define XMOVE(F) XMOVOPZ (F, +=, 0) + XMOVOPZ (pcrel_relocs_copied, =, NULL); + XMOVE (gotplt_refcount); + XMOVE (gotplt_offset); + XMOVE (reg_got_refcount); + XMOVE (tprel_refcount); + XMOVE (dtp_refcount); +#undef XMOVE +#undef XMOVOPZ + + _bfd_elf_link_hash_copy_indirect (info, dir, ind); +} + /* Look through the relocs for a section during the first phase. */ static bfd_boolean @@ -4238,6 +4267,8 @@ elf_cris_got_elt_size (bfd *abfd ATTRIBUTE_UNUSED, elf_cris_link_hash_table_create #define elf_backend_adjust_dynamic_symbol \ elf_cris_adjust_dynamic_symbol +#define elf_backend_copy_indirect_symbol \ + elf_cris_copy_indirect_symbol #define elf_backend_size_dynamic_sections \ elf_cris_size_dynamic_sections #define elf_backend_init_index_section _bfd_elf_init_1_index_section |