1 ## Check how obj2yaml produces YAML .stack_sizes descriptions.
3 ## Check that obj2yaml uses the "Entries" tag to describe a .stack_sizes section
4 ## when it can extract <address, size> pairs.
6 # RUN: yaml2obj --docnum=1 %s -o %t1
7 # RUN: obj2yaml %t1 | FileCheck %s --check-prefix=VALID
10 # VALID-NEXT: FileHeader:
11 # VALID-NEXT: Class: ELFCLASS64
12 # VALID-NEXT: Data: ELFDATA2LSB
13 # VALID-NEXT: Type: ET_EXEC
14 # VALID-NEXT: Machine: EM_X86_64
15 # VALID-NEXT: Sections:
16 # VALID-NEXT: - Name: .stack_sizes
17 # VALID-NEXT: Type: SHT_PROGBITS
18 # VALID-NEXT: Entries:
19 # VALID-NEXT: - Address: 0x0000000000000010
20 # VALID-NEXT: Size: 0x0000000000000020
21 # VALID-NEXT: - Address: 0x0000000000000030
22 # VALID-NEXT: Size: 0x0000000000000040
33 Content: "100000000000000020300000000000000040"
35 ## Check that obj2yaml uses the "Content" tag to describe a .stack_sizes section
36 ## when it can't extract the entries, for example, when section data is truncated.
38 # RUN: yaml2obj --docnum=2 %s -o %t2
39 # RUN: obj2yaml %t2 | FileCheck %s --check-prefix=INVALID
42 # INVALID-NEXT: FileHeader:
43 # INVALID-NEXT: Class: ELFCLASS64
44 # INVALID-NEXT: Data: ELFDATA2LSB
45 # INVALID-NEXT: Type: ET_EXEC
46 # INVALID-NEXT: Machine: EM_X86_64
47 # INVALID-NEXT: Sections:
48 # INVALID-NEXT: - Name: .stack_sizes
49 # INVALID-NEXT: Type: SHT_PROGBITS
50 # INVALID-NEXT: Content: '1000000000000000203000000000000000'
61 Content: "1000000000000000203000000000000000"
63 ## Check obj2yaml can dump empty .stack_sizes.
65 # RUN: yaml2obj --docnum=3 %s -o %t3
66 # RUN: obj2yaml %t3 | FileCheck %s --check-prefix=EMPTY
69 # EMPTY-NEXT: FileHeader:
70 # EMPTY-NEXT: Class: ELFCLASS64
71 # EMPTY-NEXT: Data: ELFDATA2LSB
72 # EMPTY-NEXT: Type: ET_EXEC
73 # EMPTY-NEXT: Machine: EM_X86_64
74 # EMPTY-NEXT: Sections:
75 # EMPTY-NEXT: - Name: .stack_sizes
76 # EMPTY-NEXT: Type: SHT_PROGBITS
77 # EMPTY-NEXT: Content: ''