1RUN: %python %p/../Inputs/ungzip.py %p/Inputs/many-sections.o.gz > %t 2RUN: llvm-objcopy %t %t2 3RUN: llvm-readobj --file-headers %t2 | FileCheck --check-prefix=EHDR %s 4RUN: llvm-readobj --sections %t2 | FileCheck --check-prefix=SECS %s 5RUN: llvm-readobj --symbols %t2 | grep "Symbol {" | wc -l | FileCheck --check-prefix=SYMS %s 6RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefix=SYM_SEC_IDS 7 8EHDR: Format: elf64-x86-64 9EHDR-NEXT: Arch: x86_64 10EHDR-NEXT: AddressSize: 64bit 11EHDR-NEXT: LoadName: 12EHDR-NEXT: ElfHeader { 13EHDR-NEXT: Ident { 14EHDR-NEXT: Magic: (7F 45 4C 46) 15EHDR-NEXT: Class: 64-bit (0x2) 16EHDR-NEXT: DataEncoding: LittleEndian (0x1) 17EHDR-NEXT: FileVersion: 1 18EHDR-NEXT: OS/ABI: SystemV (0x0) 19EHDR-NEXT: ABIVersion: 0 20EHDR-NEXT: Unused: (00 00 00 00 00 00 00) 21EHDR-NEXT: } 22EHDR-NEXT: Type: Relocatable (0x1) 23EHDR-NEXT: Machine: EM_X86_64 (0x3E) 24EHDR-NEXT: Version: 1 25EHDR-NEXT: Entry: 0x0 26EHDR-NEXT: ProgramHeaderOffset: 0x0 27EHDR-NEXT: SectionHeaderOffset: 28EHDR-NEXT: Flags [ (0x0) 29EHDR-NEXT: ] 30EHDR-NEXT: HeaderSize: 64 31EHDR-NEXT: ProgramHeaderEntrySize: 0 32EHDR-NEXT: ProgramHeaderCount: 0 33EHDR-NEXT: SectionHeaderEntrySize: 64 34EHDR-NEXT: SectionHeaderCount: 0 35EHDR-NEXT: StringTableSectionIndex: 65535 36EHDR-NEXT: } 37 38SECS: Index: 65285 39SECS-NEXT: Name: .symtab 40SECS-NEXT: Type: SHT_SYMTAB 41SECS: Name: .symtab_shndx 42SECS-NEXT: Type: SHT_SYMTAB_SHNDX 43SECS-NEXT: Flags [ (0x0) 44SECS-NEXT: ] 45SECS-NEXT: Address: 0x0 46SECS-NEXT: Offset: 47# There should be #syms * EntrySize bytes. 48SECS-NEXT: Size: 261136 49SECS-NEXT: Link: 65285 50SECS-NEXT: Info: 51SECS-NEXT: AddressAlignment: 4 52SECS-NEXT: EntrySize: 4 53SECS: Index: 65287 54SYMS: 65284 55 56SYM_SEC_IDS: Section: s9 (0xFEFF) 57SYM_SEC_IDS-NEXT: } 58SYM_SEC_IDS-NEXT: Symbol { 59SYM_SEC_IDS-NEXT: Name: s9 (37) 60SYM_SEC_IDS-NEXT: Value: 0x0 61SYM_SEC_IDS-NEXT: Size: 0 62SYM_SEC_IDS-NEXT: Binding: Local (0x0) 63SYM_SEC_IDS-NEXT: Type: None (0x0) 64SYM_SEC_IDS-NEXT: Other: 0 65SYM_SEC_IDS-NEXT: Section: s9 (0xFF01) 66SYM_SEC_IDS-NEXT: } 67SYM_SEC_IDS-NEXT: Symbol { 68SYM_SEC_IDS-NEXT: Name: s9 (37) 69SYM_SEC_IDS-NEXT: Value: 0x0 70SYM_SEC_IDS-NEXT: Size: 0 71SYM_SEC_IDS-NEXT: Binding: Local (0x0) 72SYM_SEC_IDS-NEXT: Type: None (0x0) 73SYM_SEC_IDS-NEXT: Other: 0 74SYM_SEC_IDS-NEXT: Section: s9 (0xFF00) 75SYM_SEC_IDS-NEXT: } 76SYM_SEC_IDS-NEXT: Symbol { 77SYM_SEC_IDS-NEXT: Name: s9 (37) 78SYM_SEC_IDS-NEXT: Value: 0x0 79SYM_SEC_IDS-NEXT: Size: 0 80SYM_SEC_IDS-NEXT: Binding: Local (0x0) 81SYM_SEC_IDS-NEXT: Type: None (0x0) 82SYM_SEC_IDS-NEXT: Other: 0 83SYM_SEC_IDS-NEXT: Section: s9 (0x1982) 84SYM_SEC_IDS-NEXT: } 85SYM_SEC_IDS-NEXT: Symbol { 86SYM_SEC_IDS-NEXT: Name: s9 (37) 87SYM_SEC_IDS-NEXT: Value: 0x0 88SYM_SEC_IDS-NEXT: Size: 0 89SYM_SEC_IDS-NEXT: Binding: Local (0x0) 90SYM_SEC_IDS-NEXT: Type: None (0x0) 91SYM_SEC_IDS-NEXT: Other: 0 92SYM_SEC_IDS-NEXT: Section: s9 (0xFF03) 93SYM_SEC_IDS-NEXT: } 94SYM_SEC_IDS-NEXT: Symbol { 95SYM_SEC_IDS-NEXT: Name: s9 (37) 96SYM_SEC_IDS-NEXT: Value: 0x0 97SYM_SEC_IDS-NEXT: Size: 0 98SYM_SEC_IDS-NEXT: Binding: Local (0x0) 99SYM_SEC_IDS-NEXT: Type: None (0x0) 100SYM_SEC_IDS-NEXT: Other: 0 101SYM_SEC_IDS-NEXT: Section: s9 (0xFF04) 102SYM_SEC_IDS-NEXT: } 103 104