xref: /llvm-project/llvm/test/tools/llvm-readobj/COFF/x86_64-unwind-preferred-symbol-msvc.yaml (revision 197084fcee268fa7fbbc96df0900785766f55a69)
1## Check that we print the external symbols "func1" and "func2", even though
2## the pdata relocations point at the '$LN4' symbols.
3
4# RUN: yaml2obj %s -o %t.obj
5# RUN: llvm-readobj --unwind %t.obj | FileCheck %s
6
7# CHECK: StartAddress: func1
8# CHECK: EndAddress: func1 +0x13
9# CHECK: UnwindInfoAddress: $unwind$func1
10
11# CHECK: StartAddress: func2
12# CHECK: EndAddress: func2 +0x15
13# CHECK: UnwindInfoAddress: $unwind$func2
14
15--- !COFF
16header:
17  Machine:         IMAGE_FILE_MACHINE_AMD64
18  Characteristics: [  ]
19sections:
20  - Name:            '.text$mn'
21    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
22    Alignment:       16
23    SectionData:     4883EC28488D542438E8000000004883C428C34883EC28488D54243033C9E8000000004883C428C3
24    Relocations:
25      - VirtualAddress:  10
26        SymbolName:      other
27        Type:            IMAGE_REL_AMD64_REL32
28      - VirtualAddress:  44
29        SymbolName:      other
30        Type:            IMAGE_REL_AMD64_REL32
31  - Name:            .xdata
32    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
33    Alignment:       4
34    SectionData:     '01040100044200000104010004420000'
35  - Name:            .pdata
36    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
37    Alignment:       4
38    SectionData:     '000000001300000000000000000000001500000000000000'
39    Relocations:
40      - VirtualAddress:  0
41        SymbolTableIndex: 5
42        Type:            IMAGE_REL_AMD64_ADDR32NB
43      - VirtualAddress:  4
44        SymbolTableIndex: 5
45        Type:            IMAGE_REL_AMD64_ADDR32NB
46      - VirtualAddress:  8
47        SymbolName:      '$unwind$func1'
48        Type:            IMAGE_REL_AMD64_ADDR32NB
49      - VirtualAddress:  12
50        SymbolTableIndex: 6
51        Type:            IMAGE_REL_AMD64_ADDR32NB
52      - VirtualAddress:  16
53        SymbolTableIndex: 6
54        Type:            IMAGE_REL_AMD64_ADDR32NB
55      - VirtualAddress:  20
56        SymbolName:      '$unwind$func2'
57        Type:            IMAGE_REL_AMD64_ADDR32NB
58symbols:
59  - Name:            '.text$mn'
60    Value:           0
61    SectionNumber:   1
62    SimpleType:      IMAGE_SYM_TYPE_NULL
63    ComplexType:     IMAGE_SYM_DTYPE_NULL
64    StorageClass:    IMAGE_SYM_CLASS_STATIC
65    SectionDefinition:
66      Length:          53
67      NumberOfRelocations: 2
68      NumberOfLinenumbers: 0
69      CheckSum:        973622814
70      Number:          0
71  - Name:            other
72    Value:           0
73    SectionNumber:   0
74    SimpleType:      IMAGE_SYM_TYPE_NULL
75    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
76    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
77  - Name:            func1
78    Value:           0
79    SectionNumber:   1
80    SimpleType:      IMAGE_SYM_TYPE_NULL
81    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
82    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
83  - Name:            func2
84    Value:           19
85    SectionNumber:   1
86    SimpleType:      IMAGE_SYM_TYPE_NULL
87    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
88    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
89  - Name:            '$LN4'
90    Value:           0
91    SectionNumber:   1
92    SimpleType:      IMAGE_SYM_TYPE_NULL
93    ComplexType:     IMAGE_SYM_DTYPE_NULL
94    StorageClass:    IMAGE_SYM_CLASS_LABEL
95  - Name:            '$LN4'
96    Value:           19
97    SectionNumber:   1
98    SimpleType:      IMAGE_SYM_TYPE_NULL
99    ComplexType:     IMAGE_SYM_DTYPE_NULL
100    StorageClass:    IMAGE_SYM_CLASS_LABEL
101  - Name:            .xdata
102    Value:           0
103    SectionNumber:   2
104    SimpleType:      IMAGE_SYM_TYPE_NULL
105    ComplexType:     IMAGE_SYM_DTYPE_NULL
106    StorageClass:    IMAGE_SYM_CLASS_STATIC
107    SectionDefinition:
108      Length:          16
109      NumberOfRelocations: 0
110      NumberOfLinenumbers: 0
111      CheckSum:        1006417668
112      Number:          0
113  - Name:            '$unwind$func1'
114    Value:           0
115    SectionNumber:   2
116    SimpleType:      IMAGE_SYM_TYPE_NULL
117    ComplexType:     IMAGE_SYM_DTYPE_NULL
118    StorageClass:    IMAGE_SYM_CLASS_STATIC
119  - Name:            .pdata
120    Value:           0
121    SectionNumber:   3
122    SimpleType:      IMAGE_SYM_TYPE_NULL
123    ComplexType:     IMAGE_SYM_DTYPE_NULL
124    StorageClass:    IMAGE_SYM_CLASS_STATIC
125    SectionDefinition:
126      Length:          24
127      NumberOfRelocations: 6
128      NumberOfLinenumbers: 0
129      CheckSum:        2067061152
130      Number:          0
131  - Name:            '$pdata$func1'
132    Value:           0
133    SectionNumber:   3
134    SimpleType:      IMAGE_SYM_TYPE_NULL
135    ComplexType:     IMAGE_SYM_DTYPE_NULL
136    StorageClass:    IMAGE_SYM_CLASS_STATIC
137  - Name:            '$unwind$func2'
138    Value:           8
139    SectionNumber:   2
140    SimpleType:      IMAGE_SYM_TYPE_NULL
141    ComplexType:     IMAGE_SYM_DTYPE_NULL
142    StorageClass:    IMAGE_SYM_CLASS_STATIC
143  - Name:            '$pdata$func2'
144    Value:           12
145    SectionNumber:   3
146    SimpleType:      IMAGE_SYM_TYPE_NULL
147    ComplexType:     IMAGE_SYM_DTYPE_NULL
148    StorageClass:    IMAGE_SYM_CLASS_STATIC
149...
150