89 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s2 3.section data,"",@4 .int32 415data_sym:6 .int32 427 .size data_sym, 48 9# TLS data section of size 16 with as relocations at offset 8 and 1210.section tls_sec,"T",@11.globl tls_sym12.p2align 213 .int32 0x5014tls_sym:15 .int32 0x5116 .int32 data_sym17 .int32 tls_sym18 .size tls_sym, 419 20.section .custom_section.target_features,"",@21 .int8 222 .int8 4323 .int8 724 .ascii "atomics"25 .int8 4326 .int8 1127 .ascii "bulk-memory"28 29# RUN: wasm-ld --experimental-pic -pie -no-gc-sections --shared-memory --no-entry -o %t.wasm %t.o30# RUN: obj2yaml %t.wasm | FileCheck %s31# RUN: llvm-objdump -d --no-show-raw-insn --no-leading-addr %t.wasm | FileCheck --check-prefix=ASM %s --32 33# CHECK: - Type: GLOBAL34 35# __tls_base36# CHECK-NEXT: Globals:37# CHECK-NEXT: - Index: 338# CHECK-NEXT: Type: I3239# CHECK-NEXT: Mutable: true40# CHECK-NEXT: InitExpr:41# CHECK-NEXT: Opcode: I32_CONST42# CHECK-NEXT: Value: 043 44# __tls_size45# CHECK-NEXT: - Index: 446# CHECK-NEXT: Type: I3247# CHECK-NEXT: Mutable: false48# CHECK-NEXT: InitExpr:49# CHECK-NEXT: Opcode: I32_CONST50# CHECK-NEXT: Value: 1651 52# __tls_align53# CHECK-NEXT: - Index: 554# CHECK-NEXT: Type: I3255# CHECK-NEXT: Mutable: false56# CHECK-NEXT: InitExpr:57# CHECK-NEXT: Opcode: I32_CONST58# CHECK-NEXT: Value: 459 60# ASM: <__wasm_init_tls>:61# ASM-EMPTY:62# ASM-NEXT: local.get 063# ASM-NEXT: global.set 364# ASM-NEXT: local.get 065# ASM-NEXT: i32.const 066# ASM-NEXT: i32.const 1667# ASM-NEXT: memory.init 0, 068# call to __wasm_apply_tls_relocs69# ASM-NEXT: call 370# ASM-NEXT: end71 72# ASM: <__wasm_apply_tls_relocs>:73# ASM-EMPTY:74# ASM-NEXT: i32.const 875# ASM-NEXT: global.get 376# ASM-NEXT: i32.add77# ASM-NEXT: global.get 178# ASM-NEXT: i32.const 2079# ASM-NEXT: i32.add80# ASM-NEXT: i32.store 081# ASM-NEXT: i32.const 1282# ASM-NEXT: global.get 383# ASM-NEXT: i32.add84# ASM-NEXT: global.get 385# ASM-NEXT: i32.const 486# ASM-NEXT: i32.add87# ASM-NEXT: i32.store 088# ASM-NEXT: end89