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

llvm-svn: 275977
This commit is contained in:
Peter Smith 2016-07-19 14:15:33 +00:00
parent c94489c306
commit eee35f2834
2 changed files with 13 additions and 4 deletions

View File

@ -221,6 +221,9 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
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;

View File

@ -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)
@CHECK: 70 R_ARM_TLS_LDM32 f28
@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