Index: x86_64.cc =================================================================== RCS file: /cvs/src/src/gold/x86_64.cc,v retrieving revision 1.72 diff -u -p -r1.72 x86_64.cc --- x86_64.cc 4 Aug 2008 22:22:13 -0000 1.72 +++ x86_64.cc 14 Aug 2008 22:54:30 -0000 @@ -2054,7 +2054,7 @@ Target_x86_64::Relocate::relocate_tls(co if (this->saw_tls_block_reloc_) value -= tls_segment->memsz(); } - Relocate_functions<64, false>::rela32(view, value, 0); + Relocate_functions<64, false>::rela32(view, value, addend); break; case elfcpp::R_X86_64_DTPOFF64: @@ -2065,7 +2065,7 @@ Target_x86_64::Relocate::relocate_tls(co if (this->saw_tls_block_reloc_) value -= tls_segment->memsz(); } - Relocate_functions<64, false>::rela64(view, value, 0); + Relocate_functions<64, false>::rela64(view, value, addend); break; case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec @@ -2107,7 +2107,7 @@ Target_x86_64::Relocate::relocate_tls(co case elfcpp::R_X86_64_TPOFF32: // Local-exec value -= tls_segment->memsz(); - Relocate_functions<64, false>::rela32(view, value, 0); + Relocate_functions<64, false>::rela32(view, value, addend); break; } } Index: testsuite/tls_test.cc =================================================================== RCS file: /cvs/src/src/gold/testsuite/tls_test.cc,v retrieving revision 1.6 diff -u -p -r1.6 tls_test.cc --- testsuite/tls_test.cc 17 Apr 2008 07:12:00 -0000 1.6 +++ testsuite/tls_test.cc 14 Aug 2008 22:54:30 -0000 @@ -73,6 +73,14 @@ static __thread int v4 = 4; __thread int v5; static __thread int v6; +struct int128 +{ + long long hi; + long long lo; +}; + +static __thread struct int128 v12 = { 115, 125 }; + bool t1() { @@ -187,6 +195,16 @@ t10() } bool +t12() +{ + struct int128 newval = { 335, 345 }; + CHECK_EQ_OR_RETURN((int) v12.hi, 115); + CHECK_EQ_OR_RETURN((int) v12.lo, 125); + v12 = newval; + return true; +} + +bool t_last() { CHECK_EQ_OR_RETURN(v1, 10); @@ -195,6 +213,8 @@ t_last() CHECK_EQ_OR_RETURN(v4, 40); CHECK_EQ_OR_RETURN(v5, 50); CHECK_EQ_OR_RETURN(v6, 60); + CHECK_EQ_OR_RETURN((int) v12.hi, 335); + CHECK_EQ_OR_RETURN((int) v12.lo, 345); CHECK_EQ_OR_RETURN(o1, -10); CHECK_EQ_OR_RETURN(o2, -20); CHECK_EQ_OR_RETURN(o3, -30); Index: testsuite/tls_test.h =================================================================== RCS file: /cvs/src/src/gold/testsuite/tls_test.h,v retrieving revision 1.5 diff -u -p -r1.5 tls_test.h --- testsuite/tls_test.h 17 Apr 2008 07:12:00 -0000 1.5 +++ testsuite/tls_test.h 14 Aug 2008 22:54:30 -0000 @@ -46,6 +46,8 @@ extern bool t10(); extern "C" int t11(); extern "C" int t11_last(); +extern bool t12(); + extern bool t_last(); // These variables are defined in tls_test_file2.cc Index: testsuite/tls_test_main.cc =================================================================== RCS file: /cvs/src/src/gold/testsuite/tls_test_main.cc,v retrieving revision 1.6 diff -u -p -r1.6 tls_test_main.cc --- testsuite/tls_test_main.cc 17 Apr 2008 07:12:00 -0000 1.6 +++ testsuite/tls_test_main.cc 14 Aug 2008 22:54:30 -0000 @@ -100,6 +100,7 @@ thread_routine(void* arg) f10b(f10a()); check("t10", t10()); check("t11", t11() != 0); + check("t12", t12()); check("t_last", t_last()); // Unlock the second mutex.