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: Machine: EM_X86_64
13 # FIRST-SEC-NEXT: Sections:
14 # FIRST-SEC-NEXT: - Type: SHT_NULL
15 # FIRST-SEC-NEXT: Flags: [ SHF_ALLOC ]
16 # FIRST-SEC-NEXT: Address: 0x0000000000000006
17 # FIRST-SEC-NEXT: Link: .foo
18 # FIRST-SEC-NEXT: AddressAlign: 0x0000000000000003
19 # FIRST-SEC-NEXT: EntSize: 0x0000000000000005
20 # FIRST-SEC-NEXT: Size: 0x0000000000000004
21 # FIRST-SEC-NEXT: Info: 0x0000000000000002
22 # FIRST-SEC-NEXT: - Name: .foo
23 # FIRST-SEC-NEXT: Type: SHT_PROGBITS
45 ## Check we are able to dump the SHT_NULL section with a non-zero index.
47 # RUN: yaml2obj --docnum=2 %s -o %t2
48 # RUN: obj2yaml %t2 | FileCheck %s --check-prefix=SECOND-SEC
50 # SECOND-SEC: --- !ELF
51 # SECOND-SEC-NEXT: FileHeader:
52 # SECOND-SEC-NEXT: Class: ELFCLASS64
53 # SECOND-SEC-NEXT: Data: ELFDATA2LSB
54 # SECOND-SEC-NEXT: Type: ET_REL
55 # SECOND-SEC-NEXT: Machine: EM_X86_64
56 # SECOND-SEC-NEXT: Sections:
57 # SECOND-SEC-NEXT: - Name: .foo
58 # SECOND-SEC-NEXT: Type: SHT_PROGBITS
59 # SECOND-SEC-NEXT: - Type: SHT_NULL
60 # SECOND-SEC-NEXT: Flags: [ SHF_ALLOC ]
61 # SECOND-SEC-NEXT: Address: 0x0000000000000006
62 # SECOND-SEC-NEXT: Link: .foo
63 # SECOND-SEC-NEXT: AddressAlign: 0x0000000000000003
64 # SECOND-SEC-NEXT: EntSize: 0x0000000000000005
65 # SECOND-SEC-NEXT: Content: '00000000'
66 # SECOND-SEC-NEXT: Info: 0x0000000000000002
67 # SECOND-SEC-NEXT: ...
88 ## Check we do not dump the SHT_NULL section with index 0
89 ## when it does not have any custom fields.
91 # RUN: yaml2obj --docnum=3 %s -o %t3
92 # RUN: obj2yaml %t3 | FileCheck %s --check-prefix=NULL-SEC
95 # NULL-SEC-NEXT: FileHeader:
96 # NULL-SEC-NEXT: Class: ELFCLASS64
97 # NULL-SEC-NEXT: Data: ELFDATA2LSB
98 # NULL-SEC-NEXT: Type: ET_REL
99 # NULL-SEC-NEXT: Machine: EM_X86_64
100 # NULL-SEC-NEXT: Sections:
101 # NULL-SEC-NEXT: - Name: .foo
102 # NULL-SEC-NEXT: Type: SHT_PROGBITS
116 ## Check we dump SHT_NULL sections which are not at the beginning
117 ## of the section list even if they don't have any non-null fields.
119 # RUN: yaml2obj --docnum=4 %s -o %t4
120 # RUN: obj2yaml %t4 | FileCheck %s --check-prefix=NULL-SEC-MIDDLE
122 # NULL-SEC-MIDDLE: --- !ELF
123 # NULL-SEC-MIDDLE-NEXT: FileHeader:
124 # NULL-SEC-MIDDLE-NEXT: Class: ELFCLASS64
125 # NULL-SEC-MIDDLE-NEXT: Data: ELFDATA2LSB
126 # NULL-SEC-MIDDLE-NEXT: Type: ET_REL
127 # NULL-SEC-MIDDLE-NEXT: Machine: EM_X86_64
128 # NULL-SEC-MIDDLE-NEXT: Sections:
129 # NULL-SEC-MIDDLE-NEXT: - Name: .foo
130 # NULL-SEC-MIDDLE-NEXT: Type: SHT_PROGBITS
131 # NULL-SEC-MIDDLE-NEXT: - Type: SHT_NULL
132 # NULL-SEC-MIDDLE-NEXT: ...