[llvm] r275977 - Add support for tlsldm assembler operator to ARM target
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 07:15:33 PDT 2016
Author: psmith
Date: Tue Jul 19 09:15:33 2016
New Revision: 275977
URL: http://llvm.org/viewvc/llvm-project?rev=275977&view=rev
Log:
Add support for tlsldm assembler operator to ARM target
The standard local dynamic model for TLS on ARM systems needs two
relocations:
- R_ARM_TLS_LDM32 (module idx)
- R_ARM_TLS_LDO32 (offset of object from origin of module TLS block)
In GNU style assembler we use symbol(tlsldm) and symbol(tlsldo) to
produce these relocations.
llvm-mc for ARM supports symbol(tlsldo) but does not support symbol(tlsldm).
This patch wires up the existing symbol(tlsldm) to R_ARM_TLS_LDM32.
TLS for ARM is defined in Addenda to, and Errata in, the ABI for the
ARM Architecture
Differential Revision: https://reviews.llvm.org/D22461
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
llvm/trunk/test/MC/ARM/symbol-variants.s
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=275977&r1=275976&r2=275977&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp Tue Jul 19 09:15:33 2016
@@ -221,6 +221,9 @@ unsigned ARMELFObjectWriter::GetRelocTyp
case MCSymbolRefExpr::VK_TLSDESC:
Type = ELF::R_ARM_TLS_GOTDESC;
break;
+ case MCSymbolRefExpr::VK_TLSLDM:
+ Type = ELF::R_ARM_TLS_LDM32;
+ break;
case MCSymbolRefExpr::VK_ARM_TLSDESCSEQ:
Type = ELF::R_ARM_TLS_DESCSEQ;
break;
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=275977&r1=275976&r2=275977&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/symbol-variants.s (original)
+++ llvm/trunk/test/MC/ARM/symbol-variants.s Tue Jul 19 09:15:33 2016
@@ -90,8 +90,14 @@ bl f05(plt)
@CHECK: 68 R_ARM_PREL31 f26
@CHECK: 6c R_ARM_PREL31 f27
+@ tlsldm
+.word f28(TLSLDM)
+.word f29(tlsldm)
+ at CHECK: 70 R_ARM_TLS_LDM32 f28
+ at CHECK: 74 R_ARM_TLS_LDM32 f29
+
@ got_prel
-.word f28(GOT_PREL) + (. - .Lsym)
- ldr r3, =f29(GOT_PREL)
-@ CHECK: 70 R_ARM_GOT_PREL f28
-@ CHECK: 78 R_ARM_GOT_PREL f29
+.word f30(GOT_PREL) + (. - .Lsym)
+ ldr r3, =f31(GOT_PREL)
+@ CHECK: 78 R_ARM_GOT_PREL f30
+@ CHECK: 80 R_ARM_GOT_PREL f31
More information about the llvm-commits
mailing list