--- bfd/elf32-s390.c 26 Nov 2008 10:48:43 +0100 1.98 +++ bfd/elf32-s390.c 04 Dez 2008 15:55:57 +0100 @@ -1566,11 +1566,9 @@ elf_s390_adjust_dynamic_symbol (info, h) || h->needs_plt) { if (h->plt.refcount <= 0 - || (! info->shared - && !h->def_dynamic - && !h->ref_dynamic - && h->root.type != bfd_link_hash_undefweak - && h->root.type != bfd_link_hash_undefined)) + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic @@ -1840,7 +1838,7 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if (SYMBOL_REFERENCES_LOCAL (info, h)) + if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf_s390_dyn_relocs **pp; @@ -2364,10 +2362,7 @@ elf_s390_relocate_section (output_bfd, i dyn = htab->elf.dynamic_sections_created; if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic - || h->dynindx == -1 - || h->forced_local) - && h->def_regular) + && SYMBOL_REFERENCES_LOCAL (info, h)) || (ELF_ST_VISIBILITY (h->other) && h->root.type == bfd_link_hash_undefweak)) { @@ -2537,8 +2532,7 @@ elf_s390_relocate_section (output_bfd, i && r_type != R_390_PC16DBL && r_type != R_390_PC32DBL && r_type != R_390_PC32) - || (h != NULL - && !SYMBOL_REFERENCES_LOCAL (info, h)))) + || !SYMBOL_CALLS_LOCAL (info, h))) || (ELIMINATE_COPY_RELOCS && !info->shared && h != NULL @@ -3262,10 +3256,7 @@ elf_s390_finish_dynamic_symbol (output_b The entry in the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic - || h->dynindx == -1 - || h->forced_local) - && h->def_regular) + && SYMBOL_REFERENCES_LOCAL (info, h)) { BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE); --- bfd/elf64-s390.c 04 Dez 2008 10:26:25 +0100 1.100 +++ bfd/elf64-s390.c 04 Dez 2008 15:56:44 +0100 @@ -1541,11 +1541,9 @@ elf_s390_adjust_dynamic_symbol (info, h) || h->needs_plt) { if (h->plt.refcount <= 0 - || (! info->shared - && !h->def_dynamic - && !h->ref_dynamic - && h->root.type != bfd_link_hash_undefweak - && h->root.type != bfd_link_hash_undefined)) + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic @@ -1815,7 +1813,7 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if (SYMBOL_REFERENCES_LOCAL (info, h)) + if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf_s390_dyn_relocs **pp; @@ -2340,10 +2338,7 @@ elf_s390_relocate_section (output_bfd, i dyn = htab->elf.dynamic_sections_created; if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic - || h->dynindx == -1 - || h->forced_local) - && h->def_regular) + && SYMBOL_REFERENCES_LOCAL (info, h)) || (ELF_ST_VISIBILITY (h->other) && h->root.type == bfd_link_hash_undefweak)) { @@ -2519,8 +2514,7 @@ elf_s390_relocate_section (output_bfd, i && r_type != R_390_PC32 && r_type != R_390_PC32DBL && r_type != R_390_PC64) - || (h != NULL - && !SYMBOL_REFERENCES_LOCAL (info, h)))) + || !SYMBOL_CALLS_LOCAL (info, h))) || (ELIMINATE_COPY_RELOCS && !info->shared && h != NULL @@ -3168,10 +3162,7 @@ elf_s390_finish_dynamic_symbol (output_b The entry in the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic - || h->dynindx == -1 - || h->forced_local) - && h->def_regular) + && SYMBOL_REFERENCES_LOCAL (info, h)) { BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE);