aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-sh.c')
-rw-r--r--bfd/elf32-sh.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index d8d4a6a..74f276b 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -3899,8 +3899,8 @@ sh_elf_size_dynamic_sections (output_bfd, info)
will not fill them in in the relocate_section routine. */
if (info->shared && info->symbolic)
sh_elf_link_hash_traverse (sh_elf_hash_table (info),
- sh_elf_discard_copies,
- (PTR) NULL);
+ sh_elf_discard_copies,
+ (PTR) NULL);
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
@@ -4038,6 +4038,9 @@ sh_elf_discard_copies (h, ignore)
{
struct elf_sh_pcrel_relocs_copied *s;
+ if (h->root.root.type == bfd_link_hash_warning)
+ h = (struct elf_sh_link_hash_entry *) h->root.root.u.i.link;
+
/* We only discard relocs for symbols defined in a regular object. */
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return true;