summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-05-26 00:02:12 +0000
committerEric Christopher <echristo@apple.com>2010-05-26 00:02:12 +0000
commite7b64dcc1e1f8e20001ba6bf65b38e3df367647c (patch)
tree0f3025d9be003cf3d5a6aac341a1cff3809260f0 /llvm/lib
parent66c939a2ca5d5f6176ccd014f3a946a814b87d12 (diff)
downloadbcm5719-llvm-e7b64dcc1e1f8e20001ba6bf65b38e3df367647c.tar.gz
bcm5719-llvm-e7b64dcc1e1f8e20001ba6bf65b38e3df367647c.zip
Start adding mach-o tls reloc support.
llvm-svn: 104651
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCExpr.cpp2
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp10
2 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index 068ca812268..c000dd70cda 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -177,6 +177,7 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
case VK_TPOFF: return "TPOFF";
case VK_ARM_HI16: return ":upper16:";
case VK_ARM_LO16: return ":lower16:";
+ case VK_TLVP: return "TLVP";
}
}
@@ -192,6 +193,7 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) {
.Case("PLT", VK_PLT)
.Case("TLSGD", VK_TLSGD)
.Case("TPOFF", VK_TPOFF)
+ .Case("TLVP", VK_TLVP)
.Default(VK_Invalid);
}
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 9bcb93e1471..fc742e4aa5c 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -145,7 +145,8 @@ class MachObjectWriterImpl {
RIT_Pair = 1,
RIT_Difference = 2,
RIT_PreboundLazyPointer = 3,
- RIT_LocalDifference = 4
+ RIT_LocalDifference = 4,
+ RIT_TLV = 5
};
/// X86_64 uses its own relocation types.
@@ -158,7 +159,8 @@ class MachObjectWriterImpl {
RIT_X86_64_Subtractor = 5,
RIT_X86_64_Signed1 = 6,
RIT_X86_64_Signed2 = 7,
- RIT_X86_64_Signed4 = 8
+ RIT_X86_64_Signed4 = 8,
+ RIT_X86_64_TLV = 9
};
/// MachSymbolData - Helper struct for containing some precomputed information
@@ -610,6 +612,8 @@ public:
Type = RIT_X86_64_GOT;
} else if (Modifier != MCSymbolRefExpr::VK_None) {
report_fatal_error("unsupported symbol modifier in relocation");
+ } else if (Modifier == MCSymbolRefExpr::VK_TLVP) {
+ Type = RIT_X86_64_TLV;
} else {
Type = RIT_X86_64_Signed;
@@ -650,6 +654,8 @@ public:
// required to include any necessary offset directly.
Type = RIT_X86_64_GOT;
IsPCRel = 1;
+ } else if (Modifier == MCSymbolRefExpr::VK_TLVP) {
+ report_fatal_error("TLVP symbol modifier should have been rip-rel");
} else if (Modifier != MCSymbolRefExpr::VK_None)
report_fatal_error("unsupported symbol modifier in relocation");
else
OpenPOWER on IntegriCloud