1# RUN: yaml2obj %s -o %t.o 2# RUN: wasm-ld --shared-memory -o %t.wasm %t.o 3 4# Verify compatability with older object files that didn't mark individual 5# symbols as TLS. In this case the symbol `bar` is being used in a TLS-only 6# relocation (R_WASM_MEMORY_ADDR_TLS_SLEB) but is not itself marked as TLS. 7# However, because it is defined in a section (`.mydata`) that *is* marked as 8# TLS we implicitly mark bar as TLS. 9# 10# We had a regression where llvm-13-generated object files were being rejected 11# with: "R_WASM_MEMORY_ADDR_TLS_SLEB cannot be used against non-TLS symbol" 12# This test verifies that this error is not triggered. 13 14--- !WASM 15FileHeader: 16 Version: 0x1 17Sections: 18 - Type: TYPE 19 Signatures: 20 - Index: 0 21 ParamTypes: [] 22 ReturnTypes: [] 23 - Type: IMPORT 24 Imports: 25 - Module: env 26 Field: __linear_memory 27 Kind: MEMORY 28 Memory: 29 Minimum: 0x1 30 - Type: FUNCTION 31 FunctionTypes: [ 0 ] 32 - Type: DATACOUNT 33 Count: 1 34 - Type: CODE 35 Relocations: 36 - Type: R_WASM_MEMORY_ADDR_TLS_SLEB 37 Index: 1 38 Offset: 0x4 39 Functions: 40 - Index: 0 41 Locals: [] 42 Body: 4180808080001A0B 43 - Type: DATA 44 Segments: 45 - SectionOffset: 6 46 InitFlags: 0 47 Offset: 48 Opcode: I32_CONST 49 Value: 0 50 Content: '00000000' 51 - Type: CUSTOM 52 Name: linking 53 Version: 2 54 SymbolTable: 55 - Index: 0 56 Kind: FUNCTION 57 Name: _start 58 Flags: [ ] 59 Function: 0 60 - Index: 1 61 Kind: DATA 62 Name: bar 63 Flags: [ ] 64 Segment: 0 65 Size: 4 66 SegmentInfo: 67 - Index: 0 68 Name: .mydata 69 Alignment: 0 70 Flags: [ TLS ] 71 - Type: CUSTOM 72 Name: target_features 73 Features: 74 - Prefix: USED 75 Name: "atomics" 76 - Prefix: USED 77 Name: "bulk-memory" 78... 79