[llvm-commits] [llvm] r117547 - in /llvm/trunk: include/llvm/MC/MCExpr.h lib/MC/ELFObjectWriter.cpp lib/MC/MCExpr.cpp test/MC/ELF/relocation.s
Rafael Espindola
rafael.espindola at gmail.com
Thu Oct 28 08:02:40 PDT 2010
Author: rafael
Date: Thu Oct 28 10:02:40 2010
New Revision: 117547
URL: http://llvm.org/viewvc/llvm-project?rev=117547&view=rev
Log:
Implement TLSLD.
Modified:
llvm/trunk/include/llvm/MC/MCExpr.h
llvm/trunk/lib/MC/ELFObjectWriter.cpp
llvm/trunk/lib/MC/MCExpr.cpp
llvm/trunk/test/MC/ELF/relocation.s
Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=117547&r1=117546&r2=117547&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Thu Oct 28 10:02:40 2010
@@ -137,6 +137,7 @@
VK_GOTNTPOFF,
VK_PLT,
VK_TLSGD,
+ VK_TLSLD,
VK_TLSLDM,
VK_TPOFF,
VK_DTPOFF,
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=117547&r1=117546&r2=117547&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Thu Oct 28 10:02:40 2010
@@ -93,6 +93,7 @@
case MCSymbolRefExpr::VK_GOTNTPOFF:
case MCSymbolRefExpr::VK_TLSLDM:
case MCSymbolRefExpr::VK_DTPOFF:
+ case MCSymbolRefExpr::VK_TLSLD:
return true;
}
}
@@ -701,6 +702,9 @@
case MCSymbolRefExpr::VK_TLSGD:
Type = ELF::R_X86_64_TLSGD;
break;
+ case MCSymbolRefExpr::VK_TLSLD:
+ Type = ELF::R_X86_64_TLSLD;
+ break;
}
} else {
switch ((unsigned)Fixup.getKind()) {
Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=117547&r1=117546&r2=117547&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Thu Oct 28 10:02:40 2010
@@ -178,6 +178,7 @@
case VK_GOTNTPOFF: return "GOTNTPOFF";
case VK_PLT: return "PLT";
case VK_TLSGD: return "TLSGD";
+ case VK_TLSLD: return "TLSLD";
case VK_TLSLDM: return "TLSLDM";
case VK_TPOFF: return "TPOFF";
case VK_DTPOFF: return "DTPOFF";
@@ -200,6 +201,7 @@
.Case("GOTNTPOFF", VK_GOTNTPOFF)
.Case("PLT", VK_PLT)
.Case("TLSGD", VK_TLSGD)
+ .Case("TLSLD", VK_TLSLD)
.Case("TLSLDM", VK_TLSLDM)
.Case("TPOFF", VK_TPOFF)
.Case("DTPOFF", VK_DTPOFF)
Modified: llvm/trunk/test/MC/ELF/relocation.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation.s?rev=117547&r1=117546&r2=117547&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/relocation.s (original)
+++ llvm/trunk/test/MC/ELF/relocation.s Thu Oct 28 10:02:40 2010
@@ -12,6 +12,7 @@
leaq foo at GOTTPOFF(%rip), %rax # R_X86_64_GOTTPOFF
leaq foo at TLSGD(%rip), %rax # R_X86_64_TLSGD
leaq foo at TPOFF(%rax), %rax # R_X86_64_TPOFF32
+ leaq foo at TLSLD(%rip), %rdi # R_X86_64_TLSLD
// CHECK: # Section 0x00000001
// CHECK: (('sh_name', 0x00000001) # '.text'
@@ -76,3 +77,9 @@
// CHECK-NEXT: ('r_sym', 0x00000006)
// CHECK-NEXT: ('r_type', 0x00000017)
// CHECK-NEXT: ('r_addend', 0x00000000)
+
+// CHECK: # Relocation 0x00000009
+// CHECK-NEXT: (('r_offset', 0x00000042)
+// CHECK-NEXT: ('r_sym', 0x00000006)
+// CHECK-NEXT: ('r_type', 0x00000014)
+// CHECK-NEXT: ('r_addend', 0xfffffffc)
More information about the llvm-commits
mailing list