cranelift: Add COFF TLS Support (#4546)

* cranelift: Implement COFF TLS Relocations

* cranelift: Emit SecRel relocations

* cranelift: Handle _tls_index symbol in backend
This commit is contained in:
Afonso Bordado
2022-08-11 17:33:40 +01:00
committed by GitHub
parent a40b253792
commit c5bc368cfe
10 changed files with 153 additions and 29 deletions

View File

@@ -0,0 +1,20 @@
test compile precise-output
set tls_model=coff
target x86_64
function u0:0(i32) -> i64 {
gv0 = symbol colocated tls u1:0
block0(v0: i32):
v1 = global_value.i64 gv0
return v1
}
; pushq %rbp
; movq %rsp, %rbp
; block0:
; %rax = coff_tls_get_addr User { namespace: 1, index: 0 }
; movq %rbp, %rsp
; popq %rbp
; ret