1 ## Check we are able to dump the SHT_NULL section at
2 ## index 0 when it has custom section fields.
4 # RUN: yaml2obj --docnum=1 %s -o %t1
5 # RUN: obj2yaml %t1 | FileCheck %s --check-prefix=FIRST-SEC
8 # FIRST-SEC-NEXT: FileHeader:
9 # FIRST-SEC-NEXT: Class: ELFCLASS64
10 # FIRST-SEC-NEXT: Data: ELFDATA2LSB
11 # FIRST-SEC-NEXT: Type: ET_REL
12 # FIRST-SEC-NEXT: Sections:
13 # FIRST-SEC-NEXT: - Type: SHT_NULL
14 # FIRST-SEC-NEXT: Flags: [ SHF_ALLOC ]
15 # FIRST-SEC-NEXT: Address: 0x6
16 # FIRST-SEC-NEXT: Link: .foo
17 # FIRST-SEC-NEXT: AddressAlign: 0x3
18 # FIRST-SEC-NEXT: EntSize: 0x5
19 # FIRST-SEC-NEXT: Size: 0x4
20 # FIRST-SEC-NEXT: Info: 0x2
21 # FIRST-SEC-NEXT: - Name: .foo
22 # FIRST-SEC-NEXT: Type: SHT_PROGBITS
43 ## Check we are able to dump the SHT_NULL section with a non-zero index.
45 # RUN: yaml2obj --docnum=2 %s -o %t2
46 # RUN: obj2yaml %t2 | FileCheck %s --check-prefix=SECOND-SEC
48 # SECOND-SEC: --- !ELF
49 # SECOND-SEC-NEXT: FileHeader:
50 # SECOND-SEC-NEXT: Class: ELFCLASS64
51 # SECOND-SEC-NEXT: Data: ELFDATA2LSB
52 # SECOND-SEC-NEXT: Type: ET_REL
53 # SECOND-SEC-NEXT: Sections:
54 # SECOND-SEC-NEXT: - Name: .foo
55 # SECOND-SEC-NEXT: Type: SHT_PROGBITS
56 # SECOND-SEC-NEXT: - Type: SHT_NULL
57 # SECOND-SEC-NEXT: Flags: [ SHF_ALLOC ]
58 # SECOND-SEC-NEXT: Address: 0x6
59 # SECOND-SEC-NEXT: Link: .foo
60 # SECOND-SEC-NEXT: AddressAlign: 0x3
61 # SECOND-SEC-NEXT: EntSize: 0x5
62 # SECOND-SEC-NEXT: Content: '00000000'
63 # SECOND-SEC-NEXT: Info: 0x2
64 # SECOND-SEC-NEXT: ...
84 ## Check we do not dump the SHT_NULL section with index 0
85 ## when it does not have any custom fields.
87 # RUN: yaml2obj --docnum=3 %s -o %t3
88 # RUN: obj2yaml %t3 | FileCheck %s --check-prefix=NULL-SEC
91 # NULL-SEC-NEXT: FileHeader:
92 # NULL-SEC-NEXT: Class: ELFCLASS64
93 # NULL-SEC-NEXT: Data: ELFDATA2LSB
94 # NULL-SEC-NEXT: Type: ET_REL
95 # NULL-SEC-NEXT: Sections:
96 # NULL-SEC-NEXT: - Name: .foo
97 # NULL-SEC-NEXT: Type: SHT_PROGBITS
110 ## Check we dump SHT_NULL sections which are not at the beginning
111 ## of the section list even if they don't have any non-null fields.
113 # RUN: yaml2obj --docnum=4 %s -o %t4
114 # RUN: obj2yaml %t4 | FileCheck %s --check-prefix=NULL-SEC-MIDDLE
116 # NULL-SEC-MIDDLE: --- !ELF
117 # NULL-SEC-MIDDLE-NEXT: FileHeader:
118 # NULL-SEC-MIDDLE-NEXT: Class: ELFCLASS64
119 # NULL-SEC-MIDDLE-NEXT: Data: ELFDATA2LSB
120 # NULL-SEC-MIDDLE-NEXT: Type: ET_REL
121 # NULL-SEC-MIDDLE-NEXT: Sections:
122 # NULL-SEC-MIDDLE-NEXT: - Name: .foo
123 # NULL-SEC-MIDDLE-NEXT: Type: SHT_PROGBITS
124 # NULL-SEC-MIDDLE-NEXT: - Type: SHT_NULL
125 # NULL-SEC-MIDDLE-NEXT: ...