• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: yaml2obj %s > %t1.o
2# RUN: yaml2obj %s > %t2.o
3
4# RUN: echo -ne "\x04" > %t.stats
5
6# RUN: echo -n "%t1.o" >> %t.stats
7# RUN: echo -ne "\x00" >> %t.stats
8# RUN: echo -ne "\x01\x00\x00\x00\x01\x00\x00\x00" >> %t.stats
9# RUN: echo -ne "\x11\x00\x00\x00\x02\x00\x00\x20" >> %t.stats
10# RUN: echo -ne "\x21\x00\x00\x00\x03\x00\x00\x40" >> %t.stats
11# RUN: echo -ne "\x01\x00\x00\x00\x04\x00\x00\x60" >> %t.stats
12# RUN: echo -ne "\x11\x00\x00\x00\x05\x00\x00\x80" >> %t.stats
13# RUN: echo -ne "\x21\x00\x00\x00\x06\x00\x00\xa0" >> %t.stats
14# RUN: echo -ne "\x00\x00\x00\x00\x00\x00\x00\x00" >> %t.stats
15
16# RUN: echo -n "%t2.o" >> %t.stats
17# RUN: echo -ne "\x00" >> %t.stats
18# RUN: echo -ne "\x21\x00\x00\x00\x07\x00\x00\x00" >> %t.stats
19# RUN: echo -ne "\x11\x00\x00\x00\x08\x00\x00\x20" >> %t.stats
20# RUN: echo -ne "\x01\x00\x00\x00\x09\x00\x00\x40" >> %t.stats
21# RUN: echo -ne "\x21\x00\x00\x00\x0b\x00\x00\x60" >> %t.stats
22# RUN: echo -ne "\x11\x00\x00\x00\x0c\x00\x00\x80" >> %t.stats
23# RUN: echo -ne "\x01\x00\x00\x00\x0e\x00\x00\xa0" >> %t.stats
24# RUN: echo -ne "\x00\x00\x00\x00\x00\x00\x00\x00" >> %t.stats
25
26# RUN: sanstats %t.stats | FileCheck %s
27
28# CHECK: /tmp{{[/\\]}}f.c:1 f1 cfi-vcall 1
29# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 2
30# CHECK: /tmp{{[/\\]}}f.c:3 f3 cfi-derived-cast 3
31# CHECK: /tmp{{[/\\]}}f.c:1 f1 cfi-unrelated-cast 4
32# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-icall 5
33# CHECK: /tmp{{[/\\]}}f.c:3 f3 <unknown> 6
34
35# CHECK: /tmp{{[/\\]}}f.c:3 f3 cfi-vcall 7
36# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-nvcall 8
37# CHECK: /tmp{{[/\\]}}f.c:1 f1 cfi-derived-cast 9
38# CHECK: /tmp{{[/\\]}}f.c:3 f3 cfi-unrelated-cast 11
39# CHECK: /tmp{{[/\\]}}f.c:2 f2 cfi-icall 12
40# CHECK: /tmp{{[/\\]}}f.c:1 f1 <unknown> 14
41
42--- !ELF
43FileHeader:
44  Class:           ELFCLASS64
45  Data:            ELFDATA2LSB
46  Type:            ET_REL
47  Machine:         EM_X86_64
48Sections:
49  - Name:            .text
50    Type:            SHT_PROGBITS
51    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
52    AddressAlign:    0x0000000000000010
53    Content:         554889E55DC3662E0F1F840000000000554889E55DC3662E0F1F840000000000554889E55DC3
54  - Name:            .debug_str
55    Type:            SHT_PROGBITS
56    Flags:           [ SHF_MERGE, SHF_STRINGS ]
57    AddressAlign:    0x0000000000000001
58    Content:         636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900662E63002F746D7000663100663200663300
59  - Name:            .debug_loc
60    Type:            SHT_PROGBITS
61    AddressAlign:    0x0000000000000001
62    Content:         ''
63  - Name:            .debug_abbrev
64    Type:            SHT_PROGBITS
65    AddressAlign:    0x0000000000000001
66    Content:         011101250E1305030E10171B0E110112060000022E00110112064018030E3A0B3B0B3F19000000
67  - Name:            .debug_info
68    Type:            SHT_PROGBITS
69    AddressAlign:    0x0000000000000001
70    Content:         660000000400000000000801000000000C0000000000000000000000000000000000000000002600000002000000000000000006000000015600000000010102000000000000000006000000015600000000010202000000000000000006000000015600000000010300
71  - Name:            .rela.debug_info
72    Type:            SHT_RELA
73    Link:            .symtab
74    AddressAlign:    0x0000000000000008
75    Info:            .debug_info
76    Relocations:
77      - Offset:          0x0000000000000006
78        Symbol:          ''
79        Type:            R_X86_64_32
80      - Offset:          0x000000000000000C
81        Symbol:          ''
82        Type:            R_X86_64_32
83      - Offset:          0x0000000000000012
84        Symbol:          ''
85        Type:            R_X86_64_32
86        Addend:          55
87      - Offset:          0x0000000000000016
88        Symbol:          ''
89        Type:            R_X86_64_32
90      - Offset:          0x000000000000001A
91        Symbol:          ''
92        Type:            R_X86_64_32
93        Addend:          59
94      - Offset:          0x000000000000001E
95        Symbol:          ''
96        Type:            R_X86_64_64
97      - Offset:          0x000000000000002B
98        Symbol:          ''
99        Type:            R_X86_64_64
100      - Offset:          0x0000000000000039
101        Symbol:          ''
102        Type:            R_X86_64_32
103        Addend:          64
104      - Offset:          0x0000000000000040
105        Symbol:          ''
106        Type:            R_X86_64_64
107        Addend:          16
108      - Offset:          0x000000000000004E
109        Symbol:          ''
110        Type:            R_X86_64_32
111        Addend:          67
112      - Offset:          0x0000000000000055
113        Symbol:          ''
114        Type:            R_X86_64_64
115        Addend:          32
116      - Offset:          0x0000000000000063
117        Symbol:          ''
118        Type:            R_X86_64_32
119        Addend:          70
120  - Name:            .debug_ranges
121    Type:            SHT_PROGBITS
122    AddressAlign:    0x0000000000000001
123    Content:         ''
124  - Name:            .debug_pubnames
125    Type:            SHT_PROGBITS
126    AddressAlign:    0x0000000000000001
127    Content:         230000000200000000006A0000002A0000006631003F0000006632005400000066330000000000
128  - Name:            .rela.debug_pubnames
129    Type:            SHT_RELA
130    Link:            .symtab
131    AddressAlign:    0x0000000000000008
132    Info:            .debug_pubnames
133    Relocations:
134      - Offset:          0x0000000000000006
135        Symbol:          ''
136        Type:            R_X86_64_32
137  - Name:            .comment
138    Type:            SHT_PROGBITS
139    Flags:           [ SHF_MERGE, SHF_STRINGS ]
140    AddressAlign:    0x0000000000000001
141    Content:         00636C616E672076657273696F6E20332E382E3020287472756E6B203235353339332920286C6C766D2F7472756E6B203235353734352900
142  - Name:            .note.GNU-stack
143    Type:            SHT_PROGBITS
144    AddressAlign:    0x0000000000000001
145    Content:         ''
146  - Name:            .eh_frame
147    Type:            SHT_X86_64_UNWIND
148    Flags:           [ SHF_ALLOC ]
149    AddressAlign:    0x0000000000000008
150    Content:         1400000000000000017A5200017810011B0C070890010000180000001C000000000000000600000000410E108602430D060000001800000038000000000000000600000000410E108602430D060000001C00000054000000000000000600000000410E108602430D0600000000000000
151  - Name:            .rela.eh_frame
152    Type:            SHT_RELA
153    Link:            .symtab
154    AddressAlign:    0x0000000000000008
155    Info:            .eh_frame
156    Relocations:
157      - Offset:          0x0000000000000020
158        Symbol:          ''
159        Type:            R_X86_64_PC32
160      - Offset:          0x000000000000003C
161        Symbol:          ''
162        Type:            R_X86_64_PC32
163        Addend:          16
164      - Offset:          0x0000000000000058
165        Symbol:          ''
166        Type:            R_X86_64_PC32
167        Addend:          32
168  - Name:            .debug_line
169    Type:            SHT_PROGBITS
170    AddressAlign:    0x0000000000000001
171    Content:         4300000002001A0000000101FB0E0D00010101010000000100000100662E630000000000000902000000000000000001050C0A4A0500BB050C0A4A0500BB050C0A4A0202000101
172  - Name:            .rela.debug_line
173    Type:            SHT_RELA
174    Link:            .symtab
175    AddressAlign:    0x0000000000000008
176    Info:            .debug_line
177    Relocations:
178      - Offset:          0x0000000000000027
179        Symbol:          ''
180        Type:            R_X86_64_64
181Symbols:
182  Local:
183    - Name:            f.c
184      Type:            STT_FILE
185    - Type:            STT_SECTION
186      Section:         .text
187    - Type:            STT_SECTION
188      Section:         .debug_str
189    - Type:            STT_SECTION
190      Section:         .debug_abbrev
191    - Type:            STT_SECTION
192      Section:         .debug_info
193    - Type:            STT_SECTION
194      Section:         .debug_line
195  Global:
196    - Name:            f1
197      Type:            STT_FUNC
198      Section:         .text
199      Size:            0x0000000000000006
200    - Name:            f2
201      Type:            STT_FUNC
202      Section:         .text
203      Value:           0x0000000000000010
204      Size:            0x0000000000000006
205    - Name:            f3
206      Type:            STT_FUNC
207      Section:         .text
208      Value:           0x0000000000000020
209      Size:            0x0000000000000006
210...
211