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