106 lines · plain
1## Check what --sections prints when there is no section header string table.2 3# RUN: yaml2obj %s -o %t4# RUN: llvm-readelf --sections %t \5# RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix=GNU6# RUN: llvm-readobj --sections %t 2>&1 \7# RUN: | FileCheck %s -DFILE=%t --check-prefix=LLVM8 9# GNU:Section Headers:10# GNU-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al11# GNU-NEXT: [ 0] <no-strings> NULL 0000000000000000 000000 000000 00 0 0 012# GNU-NEXT: [ 1] <no-strings> PROGBITS 0000000000000000 000040 000000 00 0 0 013# GNU-NEXT: [ 2] <no-strings> PROGBITS 0000000000000000 000040 000000 00 0 0 014# GNU-NEXT: [ 3] <no-strings> STRTAB 0000000000000000 000040 000001 00 0 0 115# GNU-NEXT: [ 4] <no-strings> STRTAB 0000000000000000 000041 00001d 00 0 0 116 17# LLVM: Sections [18# LLVM-NEXT: Section {19# LLVM-NEXT: Index: 020# LLVM-NEXT: Name: (0)21# LLVM-NEXT: Type: SHT_NULL (0x0)22# LLVM-NEXT: Flags [ (0x0)23# LLVM-NEXT: ]24# LLVM-NEXT: Address: 0x025# LLVM-NEXT: Offset: 0x026# LLVM-NEXT: Size: 027# LLVM-NEXT: Link: 028# LLVM-NEXT: Info: 029# LLVM-NEXT: AddressAlignment: 030# LLVM-NEXT: EntrySize: 031# LLVM-NEXT: }32# LLVM-NEXT: Section {33# LLVM-NEXT: Index: 134# LLVM-NEXT: Name: (0)35# LLVM-NEXT: Type: SHT_PROGBITS (0x1)36# LLVM-NEXT: Flags [ (0x0)37# LLVM-NEXT: ]38# LLVM-NEXT: Address: 0x039# LLVM-NEXT: Offset: 0x4040# LLVM-NEXT: Size: 041# LLVM-NEXT: Link: 042# LLVM-NEXT: Info: 043# LLVM-NEXT: AddressAlignment: 044# LLVM-NEXT: EntrySize: 045# LLVM-NEXT: }46# LLVM-NEXT: Section {47# LLVM-NEXT: Index: 248# 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 table49# LLVM-NEXT: Name: <?> (1)50# LLVM-NEXT: Type: SHT_PROGBITS (0x1)51# LLVM-NEXT: Flags [ (0x0)52# LLVM-NEXT: ]53# LLVM-NEXT: Address: 0x054# LLVM-NEXT: Offset: 0x4055# LLVM-NEXT: Size: 056# LLVM-NEXT: Link: 057# LLVM-NEXT: Info: 058# LLVM-NEXT: AddressAlignment: 059# LLVM-NEXT: EntrySize: 060# LLVM-NEXT: }61# LLVM-NEXT: Section {62# LLVM-NEXT: Index: 363# 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 table64# LLVM-NEXT: Name: <?> (21)65# LLVM-NEXT: Type: SHT_STRTAB (0x3)66# LLVM-NEXT: Flags [ (0x0)67# LLVM-NEXT: ]68# LLVM-NEXT: Address: 0x069# LLVM-NEXT: Offset: 0x4070# LLVM-NEXT: Size: 171# LLVM-NEXT: Link: 072# LLVM-NEXT: Info: 073# LLVM-NEXT: AddressAlignment: 174# LLVM-NEXT: EntrySize: 075# LLVM-NEXT: }76# LLVM-NEXT: Section {77# LLVM-NEXT: Index: 478# 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 table79# LLVM-NEXT: Name: <?> (11)80# LLVM-NEXT: Type: SHT_STRTAB (0x3)81# LLVM-NEXT: Flags [ (0x0)82# LLVM-NEXT: ]83# LLVM-NEXT: Address: 0x084# LLVM-NEXT: Offset: 0x4185# LLVM-NEXT: Size: 2986# LLVM-NEXT: Link: 087# LLVM-NEXT: Info: 088# LLVM-NEXT: AddressAlignment: 189# LLVM-NEXT: EntrySize: 090# LLVM-NEXT: }91# LLVM-NEXT: ]92 93--- !ELF94FileHeader:95 Class: ELFCLASS6496 Data: ELFDATA2LSB97 Type: ET_DYN98 EShStrNdx: 099Sections:100 - Name: .foo101 Type: SHT_PROGBITS102 ShName: 0103 - Name: .bar104 Type: SHT_PROGBITS105 ShName: 1106