diff options
Diffstat (limited to 'bfd/elf32-microblaze.c')
-rw-r--r-- | bfd/elf32-microblaze.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index 94ef09e..494b636 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -1002,6 +1002,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, else { bfd_vma relocation; + bfd_boolean resolved_to_zero; /* This is a final link. */ sym = NULL; @@ -1041,6 +1042,9 @@ microblaze_elf_relocate_section (bfd *output_bfd, goto check_reloc; } + resolved_to_zero = (h != NULL + && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)); + switch ((int) r_type) { case (int) R_MICROBLAZE_SRO32 : @@ -1257,7 +1261,8 @@ microblaze_elf_relocate_section (bfd *output_bfd, /* Need to generate relocs ? */ if ((bfd_link_pic (info) || indx != 0) && (h == NULL - || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + && !resolved_to_zero) || h->root.type != bfd_link_hash_undefweak)) need_relocs = TRUE; @@ -1432,7 +1437,8 @@ microblaze_elf_relocate_section (bfd *output_bfd, if ((bfd_link_pic (info) && (h == NULL - || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + && !resolved_to_zero) || h->root.type != bfd_link_hash_undefweak) && (!howto->pc_relative || (h != NULL @@ -2861,6 +2867,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat) pp = &p->next; } } + else if (UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)) + eh->dyn_relocs = NULL; } else { |