Skip to content

[LoongArch] Fix the type of tls-le symbols #132324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ void LoongArchMCExpr::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const {
case VK_TLS_GD_HI20:
case VK_TLS_DESC_PC_HI20:
case VK_TLS_DESC_HI20:
case VK_TLS_LE_HI20_R:
case VK_TLS_LD_PCREL20_S2:
case VK_TLS_GD_PCREL20_S2:
case VK_TLS_DESC_PCREL20_S2:
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/LoongArch/fix-tle-le-sym-type.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
; RUN: llvm-readelf -s %t-la64 | FileCheck %s --check-prefix=LA64

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

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

@tls_sym = external thread_local(localexec) global i32

Expand Down