llvm-project/llvm/test/ObjectYAML/wasm/linking_section.yaml
Sam Clegg 6c899ba6de [WebAssembly] Add first claass symbol table to wasm objects
This is combination of two patches by Nicholas Wilson:
  1. https://reviews.llvm.org/D41954
  2. https://reviews.llvm.org/D42495

Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
  to avoid the extra byte used when writing data symbols.  Although this
  bit is redundant for other symbols types (i.e. undefined can be
  implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.

Differential Revision: https://reviews.llvm.org/D43147

llvm-svn: 325860
2018-02-23 05:08:34 +00:00

74 lines
2.1 KiB
YAML

# RUN: yaml2obj %s | obj2yaml | FileCheck %s
--- !WASM
FileHeader:
Version: 0x00000001
Sections:
- Type: TYPE
Signatures:
- Index: 0
ReturnType: I32
ParamTypes:
- I32
- Type: IMPORT
Imports:
- Module: foo
Field: bar
Kind: FUNCTION
SigIndex: 0
- Type: DATA
Segments:
- MemoryIndex: 0
Offset:
Opcode: I32_CONST
Value: 4
Content: '10001000'
- MemoryIndex: 0
Offset:
Opcode: I32_CONST
Value: 8
Content: '11110000'
- Type: CUSTOM
Name: linking
DataSize: 999
SymbolTable:
- Index: 0
Kind: FUNCTION
Name: bar
Flags: [ BINDING_WEAK, UNDEFINED ]
Function: 0
SegmentInfo:
- Index: 0
Alignment: 4
Flags: [ ]
Name: mydata
- Index: 1
Alignment: 2
Flags: [ ]
Name: moredata
InitFunctions:
- Priority: 1
Symbol: 0
...
# CHECK: - Type: CUSTOM
# CHECK-NEXT: Name: linking
# CHECK-NEXT: DataSize: 999
# CHECK-NEXT: SymbolTable:
# CHECK-NEXT: - Index: 0
# CHECK-NEXT: Kind: FUNCTION
# CHECK-NEXT: Name: bar
# CHECK-NEXT: Flags: [ BINDING_WEAK, UNDEFINED ]
# CHECK-NEXT: Function: 0
# CHECK-NEXT: SegmentInfo:
# CHECK-NEXT: - Index: 0
# CHECK-NEXT: Name: mydata
# CHECK-NEXT: Alignment: 4
# CHECK-NEXT: Flags: [ ]
# CHECK-NEXT: - Index: 1
# CHECK-NEXT: Name: moredata
# CHECK-NEXT: Alignment: 2
# CHECK-NEXT: Flags: [ ]
# CHECK-NEXT: InitFunctions:
# CHECK-NEXT: - Priority: 1
# CHECK-NEXT: Symbol: 0
# CHECK-NEXT: ...