George Rimar | 6fdac3b | 2018-07-18 08:19:58 +0000 | [diff] [blame] | 1 | ## many-sections.elf-x86_64 is a file that was generated to simulate |
| 2 | ## an object with more than ~65k sections. When an ELF object |
| 3 | ## has SHN_LORESERVE (0xff00) or more sections, its e_shnum field |
| 4 | ## should be zero and sh_size of the section header at index 0 is used |
| 5 | ## to store the value. If the section name string table section index is |
| 6 | ## greater than or equal to SHN_LORESERVE, then e_shstrndx field |
| 7 | ## should have the value of SHN_XINDEX and sh_link of the section header |
| 8 | ## at index 0 is used to store the value. |
| 9 | ## |
| 10 | ## many-sections.elf-x86_64 has few sections to save disk |
| 11 | ## space, but its e_shnum, e_shstrndx, sh_size and sh_link fields are set |
| 12 | ## according to the above description, so that we can test the dumper. |
| 13 | |
George Rimar | a2b553b | 2018-07-19 14:52:57 +0000 | [diff] [blame^] | 14 | # RUN: llvm-readobj -file-headers -sections -elf-output-style GNU \ |
George Rimar | 6fdac3b | 2018-07-18 08:19:58 +0000 | [diff] [blame] | 15 | # RUN: %p/Inputs/many-sections.elf-x86_64 | FileCheck %s --check-prefix=GNU1 |
| 16 | # GNU1: Number of section headers: 0 (5) |
| 17 | # GNU1: Section header string table index: 65535 (3) |
George Rimar | a2b553b | 2018-07-19 14:52:57 +0000 | [diff] [blame^] | 18 | # GNU1: There are 5 section headers, starting at offset 0xb8 |
George Rimar | 6fdac3b | 2018-07-18 08:19:58 +0000 | [diff] [blame] | 19 | |
| 20 | # RUN: llvm-readobj -file-headers -elf-output-style LLVM \ |
| 21 | # RUN: %p/Inputs/many-sections.elf-x86_64 | FileCheck %s --check-prefix=LLVM1 |
| 22 | # LLVM1: SectionHeaderCount: 0 (5) |
| 23 | # LLVM1: StringTableSectionIndex: 65535 (3) |
| 24 | |
| 25 | ## many-sections-stripped.elf-x86_64 is many-sections.elf-x86_64 with |
| 26 | ## e_shoff field set to zero, but not e_shstrndx, to show that |
| 27 | ## this corrupt case is handled correctly. |
| 28 | |
| 29 | # RUN: llvm-readobj -file-headers -elf-output-style GNU \ |
| 30 | # RUN: %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=GNU2 |
| 31 | # GNU2: Number of section headers: 0 |
| 32 | # GNU2: Section header string table index: 65535 (corrupt: out of range) |
| 33 | |
| 34 | # RUN: llvm-readobj -file-headers -elf-output-style LLVM \ |
| 35 | # RUN: %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=LLVM2 |
| 36 | # LLVM2: SectionHeaderCount: 0 |
| 37 | # LLVM2: StringTableSectionIndex: 65535 (corrupt: out of range) |