From de4c45bd54870058d0ee91a652df9f1652b12cdb Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 4 Aug 2008 22:22:13 +0000 Subject: * symtab.h (Symbol::use_plt_offset): New function. * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset. * powerpc.cc (Relocate::relocate): Likewise. * sparc.cc (Relocate::relocate): Likewise. * x86_64.cc (Relocate::relocate): Likewise. * testsuite/weak_plt.sh: New test. * testsuite/weak_plt_main.cc: New test. * testsuite/weak_plt_shared.cc: New test. * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh. (check_PROGRAMS): Add weak_plt. (check_DATA): Add weak_plt_shared.so. (weak_plt_main_pic.o, weak_plt): New targets. (weak_plt_shared_pic.o, weak_plt_shared.so): New targets. * testsuite/Makefile.in: Rebuild. * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon gcctestdir/ld. (weak_alias_test_2.so, weak_alias_test_4.so): Likewise. * testsuite/Makefile.in: Rebuild. --- gold/sparc.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'gold/sparc.cc') diff --git a/gold/sparc.cc b/gold/sparc.cc index ded63daf30d..7da59dd3f84 100644 --- a/gold/sparc.cc +++ b/gold/sparc.cc @@ -2332,10 +2332,19 @@ Target_sparc::Relocate::relocate( // Pick the value to use for symbols defined in shared objects. Symbol_value symval; if (gsym != NULL - && (gsym->is_from_dynobj() - || (parameters->options().shared() - && (gsym->is_undefined() || gsym->is_preemptible()))) - && gsym->has_plt_offset()) + && gsym->use_plt_offset(r_type == elfcpp::R_SPARC_DISP8 + || r_type == elfcpp::R_SPARC_DISP16 + || r_type == elfcpp::R_SPARC_DISP32 + || r_type == elfcpp::R_SPARC_DISP64 + || r_type == elfcpp::R_SPARC_PC_HH22 + || r_type == elfcpp::R_SPARC_PC_HM10 + || r_type == elfcpp::R_SPARC_PC_LM22 + || r_type == elfcpp::R_SPARC_PC10 + || r_type == elfcpp::R_SPARC_PC22 + || r_type == elfcpp::R_SPARC_WDISP30 + || r_type == elfcpp::R_SPARC_WDISP22 + || r_type == elfcpp::R_SPARC_WDISP19 + || r_type == elfcpp::R_SPARC_WDISP16)) { elfcpp::Elf_Xword value; -- cgit v1.2.1