Skip to content

Commit f07f968

Browse files
zhaoqi5tstellar
authored andcommitted
Backport/20.x: [LoongArch] Fix the type of tls-le symbols
(cherry picked from commit d6dc74e)
1 parent e740675 commit f07f968

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ void LoongArchMCExpr::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const {
275275
case VK_LoongArch_TLS_GD_HI20:
276276
case VK_LoongArch_TLS_DESC_PC_HI20:
277277
case VK_LoongArch_TLS_DESC_HI20:
278+
case VK_LoongArch_TLS_LE_HI20_R:
278279
case VK_LoongArch_TLS_LD_PCREL20_S2:
279280
case VK_LoongArch_TLS_GD_PCREL20_S2:
280281
case VK_LoongArch_TLS_DESC_PCREL20_S2:

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

+4-4
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)