Skip to content

Commit e11d49c

Browse files
yavtukyavtuk
and
yavtuk
authored
[BOLT][AArch64] Adds tls relocations support (llvm#117465)
Co-authored-by: yavtuk <yavtuk@ya.ru>
1 parent 1738b75 commit e11d49c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

bolt/lib/Core/Relocation.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ static bool isSupportedAArch64(uint64_t Type) {
7575
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
7676
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
7777
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
78+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
79+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
7880
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
7981
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
8082
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
@@ -183,6 +185,8 @@ static size_t getSizeForTypeAArch64(uint64_t Type) {
183185
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
184186
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
185187
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
188+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
189+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
186190
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
187191
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
188192
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
@@ -651,6 +655,8 @@ static bool isTLSAArch64(uint64_t Type) {
651655
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
652656
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
653657
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
658+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
659+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
654660
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
655661
case ELF::R_AARCH64_TLSDESC_ADD_LO12:
656662
case ELF::R_AARCH64_TLSDESC_CALL:
@@ -716,6 +722,8 @@ static bool isPCRelativeAArch64(uint64_t Type) {
716722
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
717723
case ELF::R_AARCH64_TLSLE_ADD_TPREL_HI12:
718724
case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
725+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
726+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
719727
case ELF::R_AARCH64_LD64_GOT_LO12_NC:
720728
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
721729
case ELF::R_AARCH64_TLSDESC_ADD_LO12:

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,8 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
14491449
case ELF::R_AARCH64_TLSDESC_LD64_LO12:
14501450
case ELF::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
14511451
case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
1452+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0:
1453+
case ELF::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
14521454
case ELF::R_AARCH64_MOVW_UABS_G0:
14531455
case ELF::R_AARCH64_MOVW_UABS_G0_NC:
14541456
case ELF::R_AARCH64_MOVW_UABS_G1:

0 commit comments

Comments
 (0)