forked from OSchip/llvm-project
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:
parent
b87a21f1c3
commit
cbcecca538
|
@ -221,6 +221,9 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
|
||||||
case MCSymbolRefExpr::VK_TLSDESC:
|
case MCSymbolRefExpr::VK_TLSDESC:
|
||||||
Type = ELF::R_ARM_TLS_GOTDESC;
|
Type = ELF::R_ARM_TLS_GOTDESC;
|
||||||
break;
|
break;
|
||||||
|
case MCSymbolRefExpr::VK_TLSLDM:
|
||||||
|
Type = ELF::R_ARM_TLS_LDM32;
|
||||||
|
break;
|
||||||
case MCSymbolRefExpr::VK_ARM_TLSDESCSEQ:
|
case MCSymbolRefExpr::VK_ARM_TLSDESCSEQ:
|
||||||
Type = ELF::R_ARM_TLS_DESCSEQ;
|
Type = ELF::R_ARM_TLS_DESCSEQ;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -90,8 +90,14 @@ bl f05(plt)
|
||||||
@CHECK: 68 R_ARM_PREL31 f26
|
@CHECK: 68 R_ARM_PREL31 f26
|
||||||
@CHECK: 6c R_ARM_PREL31 f27
|
@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
|
@ got_prel
|
||||||
.word f28(GOT_PREL) + (. - .Lsym)
|
.word f30(GOT_PREL) + (. - .Lsym)
|
||||||
ldr r3, =f29(GOT_PREL)
|
ldr r3, =f31(GOT_PREL)
|
||||||
@ CHECK: 70 R_ARM_GOT_PREL f28
|
@ CHECK: 78 R_ARM_GOT_PREL f30
|
||||||
@ CHECK: 78 R_ARM_GOT_PREL f29
|
@ CHECK: 80 R_ARM_GOT_PREL f31
|
||||||
|
|
Loading…
Reference in New Issue