[llvm-branch-commits] [llvm-branch] r309187 - Merging r308978:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 26 14:36:49 PDT 2017


Author: hans
Date: Wed Jul 26 14:36:49 2017
New Revision: 309187

URL: http://llvm.org/viewvc/llvm-project?rev=309187&view=rev
Log:
Merging r308978:
------------------------------------------------------------------------
r308978 | fedor.sergeev | 2017-07-25 08:28:28 -0700 (Tue, 25 Jul 2017) | 16 lines

[Sparc] invalid adjustments in TLS_LE/TLS_LDO relocations removed

Summary:
Some SPARC TLS relocations were applying nontrivial adjustments
to zero value, leading to unexpected non-zero values in ELF and then
Solaris linker failures.

Getting rid of these adjustments.

Fixes PR33825.

Reviewers: rafael, asb, jyknight

Subscribers: joerg, jyknight, llvm-commits

Differential Revision: https://reviews.llvm.org/D35567
------------------------------------------------------------------------

Added:
    llvm/branches/release_50/test/MC/Sparc/sparc-tls-relocations.s
      - copied unchanged from r308978, llvm/trunk/test/MC/Sparc/sparc-tls-relocations.s
Modified:
    llvm/branches/release_50/   (props changed)
    llvm/branches/release_50/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp

Propchange: llvm/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 26 14:36:49 2017
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308986
+/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308978,308986

Modified: llvm/branches/release_50/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp?rev=309187&r1=309186&r2=309187&view=diff
==============================================================================
--- llvm/branches/release_50/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp (original)
+++ llvm/branches/release_50/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp Wed Jul 26 14:36:49 2017
@@ -61,14 +61,6 @@ static unsigned adjustFixupValue(unsigne
   case Sparc::fixup_sparc_lo10:
     return Value & 0x3ff;
 
-  case Sparc::fixup_sparc_tls_ldo_hix22:
-  case Sparc::fixup_sparc_tls_le_hix22:
-    return (~Value >> 10) & 0x3fffff;
-
-  case Sparc::fixup_sparc_tls_ldo_lox10:
-  case Sparc::fixup_sparc_tls_le_lox10:
-    return (~(~Value & 0x3ff)) & 0x1fff;
-
   case Sparc::fixup_sparc_h44:
     return (Value >> 22) & 0x3fffff;
 
@@ -84,6 +76,13 @@ static unsigned adjustFixupValue(unsigne
   case Sparc::fixup_sparc_hm:
     return (Value >> 32) & 0x3ff;
 
+  case Sparc::fixup_sparc_tls_ldo_hix22:
+  case Sparc::fixup_sparc_tls_le_hix22:
+  case Sparc::fixup_sparc_tls_ldo_lox10:
+  case Sparc::fixup_sparc_tls_le_lox10:
+    assert(Value == 0 && "Sparc TLS relocs expect zero Value");
+    return 0;
+
   case Sparc::fixup_sparc_tls_gd_add:
   case Sparc::fixup_sparc_tls_gd_call:
   case Sparc::fixup_sparc_tls_ldm_add:




More information about the llvm-branch-commits mailing list