## Check that we print the external symbols "func1" and "func2", even though
## the pdata relocations point at the '$LN4' symbols.

# RUN: yaml2obj %s -o %t.obj
# RUN: llvm-readobj --unwind %t.obj | FileCheck %s

# CHECK: StartAddress: func1
# CHECK: EndAddress: func1 +0x13
# CHECK: UnwindInfoAddress: $unwind$func1

# CHECK: StartAddress: func2
# CHECK: EndAddress: func2 +0x15
# CHECK: UnwindInfoAddress: $unwind$func2

--- !COFF
header:
  Machine:         IMAGE_FILE_MACHINE_AMD64
  Characteristics: [  ]
sections:
  - Name:            '.text$mn'
    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
    Alignment:       16
    SectionData:     4883EC28488D542438E8000000004883C428C34883EC28488D54243033C9E8000000004883C428C3
    Relocations:
      - VirtualAddress:  10
        SymbolName:      other
        Type:            IMAGE_REL_AMD64_REL32
      - VirtualAddress:  44
        SymbolName:      other
        Type:            IMAGE_REL_AMD64_REL32
  - Name:            .xdata
    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
    Alignment:       4
    SectionData:     '01040100044200000104010004420000'
  - Name:            .pdata
    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
    Alignment:       4
    SectionData:     '000000001300000000000000000000001500000000000000'
    Relocations:
      - VirtualAddress:  0
        SymbolTableIndex: 5
        Type:            IMAGE_REL_AMD64_ADDR32NB
      - VirtualAddress:  4
        SymbolTableIndex: 5
        Type:            IMAGE_REL_AMD64_ADDR32NB
      - VirtualAddress:  8
        SymbolName:      '$unwind$func1'
        Type:            IMAGE_REL_AMD64_ADDR32NB
      - VirtualAddress:  12
        SymbolTableIndex: 6
        Type:            IMAGE_REL_AMD64_ADDR32NB
      - VirtualAddress:  16
        SymbolTableIndex: 6
        Type:            IMAGE_REL_AMD64_ADDR32NB
      - VirtualAddress:  20
        SymbolName:      '$unwind$func2'
        Type:            IMAGE_REL_AMD64_ADDR32NB
symbols:
  - Name:            '.text$mn'
    Value:           0
    SectionNumber:   1
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
    SectionDefinition:
      Length:          53
      NumberOfRelocations: 2
      NumberOfLinenumbers: 0
      CheckSum:        973622814
      Number:          0
  - Name:            other
    Value:           0
    SectionNumber:   0
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
  - Name:            func1
    Value:           0
    SectionNumber:   1
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
  - Name:            func2
    Value:           19
    SectionNumber:   1
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
  - Name:            '$LN4'
    Value:           0
    SectionNumber:   1
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_LABEL
  - Name:            '$LN4'
    Value:           19
    SectionNumber:   1
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_LABEL
  - Name:            .xdata
    Value:           0
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
    SectionDefinition:
      Length:          16
      NumberOfRelocations: 0
      NumberOfLinenumbers: 0
      CheckSum:        1006417668
      Number:          0
  - Name:            '$unwind$func1'
    Value:           0
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
  - Name:            .pdata
    Value:           0
    SectionNumber:   3
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
    SectionDefinition:
      Length:          24
      NumberOfRelocations: 6
      NumberOfLinenumbers: 0
      CheckSum:        2067061152
      Number:          0
  - Name:            '$pdata$func1'
    Value:           0
    SectionNumber:   3
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
  - Name:            '$unwind$func2'
    Value:           8
    SectionNumber:   2
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
  - Name:            '$pdata$func2'
    Value:           12
    SectionNumber:   3
    SimpleType:      IMAGE_SYM_TYPE_NULL
    ComplexType:     IMAGE_SYM_DTYPE_NULL
    StorageClass:    IMAGE_SYM_CLASS_STATIC
...
