[llvm-commits] [llvm] r117544 - in /llvm/trunk: include/llvm/MC/MCExpr.h lib/MC/ELFObjectWriter.cpp lib/MC/MCExpr.cpp test/MC/ELF/relocation-386.s
Rafael Espindola
rafael.espindola at gmail.com
Thu Oct 28 07:37:09 PDT 2010
Author: rafael
Date: Thu Oct 28 09:37:09 2010
New Revision: 117544
URL: http://llvm.org/viewvc/llvm-project?rev=117544&view=rev
Log:
Implement TLSLDM.
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-386.s
Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=117544&r1=117543&r2=117544&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Thu Oct 28 09:37:09 2010
@@ -137,6 +137,7 @@
VK_GOTNTPOFF,
VK_PLT,
VK_TLSGD,
+ VK_TLSLDM,
VK_TPOFF,
VK_ARM_HI16, // The R_ARM_MOVT_ABS relocation (:upper16: in the asm file)
VK_ARM_LO16, // The R_ARM_MOVW_ABS_NC relocation (:lower16: in the asm file)
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=117544&r1=117543&r2=117544&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Thu Oct 28 09:37:09 2010
@@ -91,6 +91,7 @@
case MCSymbolRefExpr::VK_INDNTPOFF:
case MCSymbolRefExpr::VK_NTPOFF:
case MCSymbolRefExpr::VK_GOTNTPOFF:
+ case MCSymbolRefExpr::VK_TLSLDM:
return true;
}
}
@@ -784,6 +785,9 @@
case MCSymbolRefExpr::VK_GOTNTPOFF:
Type = ELF::R_386_TLS_GOTIE;
break;
+ case MCSymbolRefExpr::VK_TLSLDM:
+ Type = ELF::R_386_TLS_LDM;
+ break;
}
break;
case FK_Data_2: Type = ELF::R_386_16; break;
Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=117544&r1=117543&r2=117544&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Thu Oct 28 09:37:09 2010
@@ -178,6 +178,7 @@
case VK_GOTNTPOFF: return "GOTNTPOFF";
case VK_PLT: return "PLT";
case VK_TLSGD: return "TLSGD";
+ case VK_TLSLDM: return "TLSLDM";
case VK_TPOFF: return "TPOFF";
case VK_ARM_HI16: return ":upper16:";
case VK_ARM_LO16: return ":lower16:";
@@ -198,6 +199,7 @@
.Case("GOTNTPOFF", VK_GOTNTPOFF)
.Case("PLT", VK_PLT)
.Case("TLSGD", VK_TLSGD)
+ .Case("TLSLDM", VK_TLSLDM)
.Case("TPOFF", VK_TPOFF)
.Case("TLVP", VK_TLVP)
.Default(VK_Invalid);
Modified: llvm/trunk/test/MC/ELF/relocation-386.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation-386.s?rev=117544&r1=117543&r2=117544&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/relocation-386.s (original)
+++ llvm/trunk/test/MC/ELF/relocation-386.s Thu Oct 28 09:37:09 2010
@@ -85,6 +85,12 @@
// CHECK-NEXT: ('r_type', 0x00000010)
// CHECK-NEXT: ),
+// Relocation 10 (foo at TLSLDM) is of type R_386_TLS_LDM
+// CHECK-NEXT: # Relocation 0x0000000a
+// CHECK-NEXT: (('r_offset', 0x0000003d)
+// CHECK-NEXT: ('r_sym', 0x0000000b)
+// CHECK-NEXT: ('r_type', 0x00000013)
+// CHECK-NEXT: ),
.text
bar:
leal .Lfoo at GOTOFF(%ebx), %eax
@@ -106,6 +112,7 @@
movl foo at INDNTPOFF, %ecx
addl foo at NTPOFF(%eax), %eax
addl foo at GOTNTPOFF(%ebx), %ecx
+ leal foo at TLSLDM(%ebx), %eax
.section .rodata.str1.16,"aMS", at progbits,1
.Lfoo:
More information about the llvm-commits
mailing list