[llvm] r199644 - ARM: add tlsldo relocation
Kai Nacke
kai.nacke at redstar.de
Mon Jan 20 03:00:40 PST 2014
Author: redstar
Date: Mon Jan 20 05:00:40 2014
New Revision: 199644
URL: http://llvm.org/viewvc/llvm-project?rev=199644&view=rev
Log:
ARM: add tlsldo relocation
Add support for the symbol(tlsldo) relocation. This is required in order to
solve PR18554.
Reviewed by R. Golin, A. Korobeynikov.
Modified:
llvm/trunk/include/llvm/MC/MCExpr.h
llvm/trunk/lib/MC/MCExpr.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
llvm/trunk/test/MC/ARM/symbol-variants.s
Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=199644&r1=199643&r2=199644&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Mon Jan 20 05:00:40 2014
@@ -165,6 +165,7 @@ public:
VK_ARM_TARGET1,
VK_ARM_TARGET2,
VK_ARM_PREL31,
+ VK_ARM_TLSLDO, // symbol(tlsldo)
VK_PPC_LO, // symbol at l
VK_PPC_HI, // symbol at h
Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=199644&r1=199643&r2=199644&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Mon Jan 20 05:00:40 2014
@@ -184,6 +184,7 @@ StringRef MCSymbolRefExpr::getVariantKin
case VK_ARM_TARGET1: return "target1";
case VK_ARM_TARGET2: return "target2";
case VK_ARM_PREL31: return "prel31";
+ case VK_ARM_TLSLDO: return "tlsldo";
case VK_PPC_LO: return "l";
case VK_PPC_HI: return "h";
case VK_PPC_HA: return "ha";
@@ -405,6 +406,8 @@ MCSymbolRefExpr::getVariantKindForName(S
.Case("target2", VK_ARM_TARGET2)
.Case("PREL31", VK_ARM_PREL31)
.Case("prel31", VK_ARM_PREL31)
+ .Case("TLSLDO", VK_ARM_TLSLDO)
+ .Case("tlsldo", VK_ARM_TLSLDO)
.Default(VK_Invalid);
}
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp?rev=199644&r1=199643&r2=199644&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp Mon Jan 20 05:00:40 2014
@@ -250,6 +250,9 @@ unsigned ARMELFObjectWriter::GetRelocTyp
case MCSymbolRefExpr::VK_ARM_PREL31:
Type = ELF::R_ARM_PREL31;
break;
+ case MCSymbolRefExpr::VK_ARM_TLSLDO:
+ Type = ELF::R_ARM_TLS_LDO32;
+ break;
}
break;
case ARM::fixup_arm_ldst_pcrel_12:
Modified: llvm/trunk/test/MC/ARM/symbol-variants.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/symbol-variants.s?rev=199644&r1=199643&r2=199644&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/symbol-variants.s (original)
+++ llvm/trunk/test/MC/ARM/symbol-variants.s Mon Jan 20 05:00:40 2014
@@ -65,3 +65,8 @@ bl f05(plt)
@CHECK: 72 R_ARM_PREL31 f18
@CHECK: 76 R_ARM_PREL31 f19
+@ tlsldo
+.word f20(TLSLDO)
+.word f21(tlsldo)
+ at CHECK: 80 R_ARM_TLS_LDO32 f20
+ at CHECK: 84 R_ARM_TLS_LDO32 f21
More information about the llvm-commits
mailing list