llvm-project
78 строк · 2.3 Кб
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--- !WASM15FileHeader:16Version: 0x117Sections:18- Type: TYPE19Signatures:20- Index: 021ParamTypes: []22ReturnTypes: []23- Type: IMPORT24Imports:25- Module: env26Field: __linear_memory27Kind: MEMORY28Memory:29Minimum: 0x130- Type: FUNCTION31FunctionTypes: [ 0 ]32- Type: DATACOUNT33Count: 134- Type: CODE35Relocations:36- Type: R_WASM_MEMORY_ADDR_TLS_SLEB37Index: 138Offset: 0x439Functions:40- Index: 041Locals: []42Body: 4180808080001A0B43- Type: DATA44Segments:45- SectionOffset: 646InitFlags: 047Offset:48Opcode: I32_CONST49Value: 050Content: '00000000'51- Type: CUSTOM52Name: linking53Version: 254SymbolTable:55- Index: 056Kind: FUNCTION57Name: _start58Flags: [ ]59Function: 060- Index: 161Kind: DATA62Name: bar63Flags: [ ]64Segment: 065Size: 466SegmentInfo:67- Index: 068Name: .mydata69Alignment: 070Flags: [ TLS ]71- Type: CUSTOM72Name: target_features73Features:74- Prefix: USED75Name: "atomics"76- Prefix: USED77Name: "bulk-memory"78...
79