reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
# RUN: yaml2obj %s | llvm-readobj --symbols | FileCheck %s

# Test symbols with custom import module and name attributes.

--- !WASM
FileHeader:      
  Version:         0x00000001
Sections:        
  - Type:            TYPE
    Signatures:      
      - Index:           0
        ParamTypes:      []
        ReturnTypes:
          - I32
      - Index:           1
        ParamTypes:      []
        ReturnTypes:     []
  - Type:            IMPORT
    Imports:         
      - Module:          env
        Field:           __linear_memory
        Kind:            MEMORY
        Memory:          
          Initial:         0x00000000
      - Module:          env
        Field:           __indirect_function_table
        Kind:            TABLE
        Table:           
          ElemType:        FUNCREF
          Limits:          
            Initial:         0x00000000
      - Module:          red
        Field:           foo
        Kind:            FUNCTION
        SigIndex:        1
      - Module:          env
        Field:           green
        Kind:            FUNCTION
        SigIndex:        1
      - Module:          blue
        Field:           purple
        Kind:            FUNCTION
        SigIndex:        1
  - Type:            FUNCTION
    FunctionTypes:   [ 0 ]
  - Type:            CODE
    Relocations:     
      - Type:            R_WASM_FUNCTION_INDEX_LEB
        Index:           1
        Offset:          0x00000004
      - Type:            R_WASM_FUNCTION_INDEX_LEB
        Index:           2
        Offset:          0x0000000A
      - Type:            R_WASM_FUNCTION_INDEX_LEB
        Index:           3
        Offset:          0x00000010
    Functions:       
      - Index:           3
        Locals:          []
        Body:            10808080800010818080800010828080800041000B
  - Type:            CUSTOM
    Name:            linking
    Version:         2
    SymbolTable:     
      - Index:           0
        Kind:            FUNCTION
        Name:            test
        Flags:           [ VISIBILITY_HIDDEN ]
        Function:        3
      - Index:           1
        Kind:            FUNCTION
        Name:            foo
        Flags:           [ UNDEFINED ]
        Function:        0
      - Index:           2
        Kind:            FUNCTION
        Name:            bar
        Flags:           [ UNDEFINED, EXPLICIT_NAME ]
        Function:        1
      - Index:           3
        Kind:            FUNCTION
        Name:            qux
        Flags:           [ UNDEFINED, EXPLICIT_NAME ]
        Function:        2
  - Type:            CUSTOM
    Name:            producers
    Tools:           
      - Name:            clang
        Version:         '9.0.0 (trunk 359436)'
...
 
# CHECK:      Format: WASM
# CHECK-NEXT: Arch: wasm32
# CHECK-NEXT: AddressSize: 32bit
# CHECK-NEXT: Symbols [
# CHECK-NEXT:   Symbol {
# CHECK-NEXT:     Name: test
# CHECK-NEXT:     Type: FUNCTION (0x0)
# CHECK-NEXT:     Flags [ (0x4)
# CHECK-NEXT:       VISIBILITY_HIDDEN (0x4)
# CHECK-NEXT:     ]
# CHECK-NEXT:     ElementIndex: 0x3
# CHECK-NEXT:   }
# CHECK-NEXT:   Symbol {
# CHECK-NEXT:     Name: foo
# CHECK-NEXT:     Type: FUNCTION (0x0)
# CHECK-NEXT:     Flags [ (0x10)
# CHECK-NEXT:       UNDEFINED (0x10)
# CHECK-NEXT:     ]
# CHECK-NEXT:     ImportName: foo
# CHECK-NEXT:     ImportModule: red
# CHECK-NEXT:     ElementIndex: 0x0
# CHECK-NEXT:   }
# CHECK-NEXT:   Symbol {
# CHECK-NEXT:     Name: bar
# CHECK-NEXT:     Type: FUNCTION (0x0)
# CHECK-NEXT:     Flags [ (0x50)
# CHECK-NEXT:       EXPLICIT_NAME (0x40)
# CHECK-NEXT:       UNDEFINED (0x10)
# CHECK-NEXT:     ]
# CHECK-NEXT:     ImportName: green
# CHECK-NEXT:     ImportModule: env
# CHECK-NEXT:     ElementIndex: 0x1
# CHECK-NEXT:   }
# CHECK-NEXT:   Symbol {
# CHECK-NEXT:     Name: qux
# CHECK-NEXT:     Type: FUNCTION (0x0)
# CHECK-NEXT:     Flags [ (0x50)
# CHECK-NEXT:       EXPLICIT_NAME (0x40)
# CHECK-NEXT:       UNDEFINED (0x10)
# CHECK-NEXT:     ]
# CHECK-NEXT:     ImportName: purple
# CHECK-NEXT:     ImportModule: blue
# CHECK-NEXT:     ElementIndex: 0x2
# CHECK-NEXT:   }
# CHECK-NEXT: ]