1 ## Check what --sections prints when there is no section header string table.
3 # RUN: yaml2obj %s -o %t
4 # RUN: llvm-readelf --sections %t \
5 # RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix=GNU
6 # RUN: llvm-readobj --sections %t 2>&1 \
7 # RUN: | FileCheck %s -DFILE=%t --check-prefix=LLVM
10 # GNU-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
11 # GNU-NEXT: [ 0] <no-strings> NULL 0000000000000000 000000 000000 00 0 0 0
12 # GNU-NEXT: [ 1] <no-strings> PROGBITS 0000000000000000 000040 000000 00 0 0 0
13 # GNU-NEXT: [ 2] <no-strings> PROGBITS 0000000000000000 000040 000000 00 0 0 0
14 # GNU-NEXT: [ 3] <no-strings> STRTAB 0000000000000000 000040 000001 00 0 0 1
15 # GNU-NEXT: [ 4] <no-strings> STRTAB 0000000000000000 000041 00001d 00 0 0 1
18 # LLVM-NEXT: Section {
20 # LLVM-NEXT: Name: (0)
21 # LLVM-NEXT: Type: SHT_NULL (0x0)
22 # LLVM-NEXT: Flags [ (0x0)
24 # LLVM-NEXT: Address: 0x0
25 # LLVM-NEXT: Offset: 0x0
29 # LLVM-NEXT: AddressAlignment: 0
30 # LLVM-NEXT: EntrySize: 0
32 # LLVM-NEXT: Section {
34 # LLVM-NEXT: Name: (0)
35 # LLVM-NEXT: Type: SHT_PROGBITS (0x1)
36 # LLVM-NEXT: Flags [ (0x0)
38 # LLVM-NEXT: Address: 0x0
39 # LLVM-NEXT: Offset: 0x40
43 # LLVM-NEXT: AddressAlignment: 0
44 # LLVM-NEXT: EntrySize: 0
46 # LLVM-NEXT: Section {
48 # LLVM-NEXT: warning: '[[FILE]]': unable to get the name of SHT_PROGBITS section with index 2: a section [index 2] has an invalid sh_name (0x1) offset which goes past the end of the section name string table
49 # LLVM-NEXT: Name: <?> (1)
50 # LLVM-NEXT: Type: SHT_PROGBITS (0x1)
51 # LLVM-NEXT: Flags [ (0x0)
53 # LLVM-NEXT: Address: 0x0
54 # LLVM-NEXT: Offset: 0x40
58 # LLVM-NEXT: AddressAlignment: 0
59 # LLVM-NEXT: EntrySize: 0
61 # LLVM-NEXT: Section {
63 # LLVM-NEXT: warning: '[[FILE]]': unable to get the name of SHT_STRTAB section with index 3: a section [index 3] has an invalid sh_name (0x15) offset which goes past the end of the section name string table
64 # LLVM-NEXT: Name: <?> (21)
65 # LLVM-NEXT: Type: SHT_STRTAB (0x3)
66 # LLVM-NEXT: Flags [ (0x0)
68 # LLVM-NEXT: Address: 0x0
69 # LLVM-NEXT: Offset: 0x40
73 # LLVM-NEXT: AddressAlignment: 1
74 # LLVM-NEXT: EntrySize: 0
76 # LLVM-NEXT: Section {
78 # LLVM-NEXT: warning: '[[FILE]]': unable to get the name of SHT_STRTAB section with index 4: a section [index 4] has an invalid sh_name (0xb) offset which goes past the end of the section name string table
79 # LLVM-NEXT: Name: <?> (11)
80 # LLVM-NEXT: Type: SHT_STRTAB (0x3)
81 # LLVM-NEXT: Flags [ (0x0)
83 # LLVM-NEXT: Address: 0x0
84 # LLVM-NEXT: Offset: 0x41
88 # LLVM-NEXT: AddressAlignment: 1
89 # LLVM-NEXT: EntrySize: 0