X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=bfd%2Felf32-sparc.c;h=6e1c40b98c17e7489876a3d91a2dc0227768bc3e;hb=4dc570c2f5d73c82196fc6e99191c140b03f8bbe;hp=9f8f9ab81510f10c406742e9fc08e69002d02af1;hpb=5a580b3ac2af13bb20af5e0fd15904840c01f66d;p=binutils-gdb.git diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 9f8f9ab8151..6e1c40b98c1 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1267,12 +1267,12 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) break; case R_SPARC_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return FALSE; break; case R_SPARC_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) return FALSE; break; @@ -1592,17 +1592,6 @@ elf32_sparc_adjust_dynamic_symbol (info, h) return TRUE; } -/* This is the condition under which finish_dynamic_symbol will be called - from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol - routine, we'll need to do something about initializing any .plt and .got - entries in relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ @@ -1636,11 +1625,11 @@ allocate_dynrelocs (h, inf) if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) { asection *s = htab->splt; @@ -1705,7 +1694,7 @@ allocate_dynrelocs (h, inf) if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; } @@ -1724,7 +1713,7 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela); - else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); } else @@ -1777,7 +1766,7 @@ allocate_dynrelocs (h, inf) if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) + if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; } @@ -2239,7 +2228,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (off != (bfd_vma) -1); dyn = elf_hash_table (info)->dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared && (info->symbolic || h->dynindx == -1 @@ -2334,7 +2323,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1) + if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) { /* We didn't make a PLT entry for this symbol. This happens when statically linking PIC code, or when @@ -2342,9 +2331,6 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if (htab->splt == NULL) - abort (); - relocation = (htab->splt->output_section->vma + htab->splt->output_offset + h->plt.offset); @@ -2388,6 +2374,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && (! howto->pc_relative || (h != NULL && h->dynindx != -1