Skip to content

Commit d6dc74e

Browse files
authored
[LoongArch] Fix the type of tls-le symbols (llvm#132324)
1 parent 17b202f commit d6dc74e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ void LoongArchMCExpr::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const {
272272
case VK_TLS_GD_HI20:
273273
case VK_TLS_DESC_PC_HI20:
274274
case VK_TLS_DESC_HI20:
275+
case VK_TLS_LE_HI20_R:
275276
case VK_TLS_LD_PCREL20_S2:
276277
case VK_TLS_GD_PCREL20_S2:
277278
case VK_TLS_DESC_PCREL20_S2:

llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
; RUN: llvm-readelf -s %t-la64 | FileCheck %s --check-prefix=LA64
66

77
; LA32: Symbol table '.symtab' contains [[#]] entries:
8-
; LA32-NEXT: Num: Value Size Type Bind Vis Ndx Name
9-
; LA32: 00000000 0 NOTYPE GLOBAL DEFAULT UND tls_sym
8+
; LA32-NEXT: Num: Value Size Type Bind Vis Ndx Name
9+
; LA32: 00000000 0 TLS GLOBAL DEFAULT UND tls_sym
1010

1111
; LA64: Symbol table '.symtab' contains [[#]] entries:
12-
; LA64-NEXT: Num: Value Size Type Bind Vis Ndx Name
13-
; LA64: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND tls_sym
12+
; LA64-NEXT: Num: Value Size Type Bind Vis Ndx Name
13+
; LA64: 0000000000000000 0 TLS GLOBAL DEFAULT UND tls_sym
1414

1515
@tls_sym = external thread_local(localexec) global i32
1616

0 commit comments

Comments
 (0)