blob: 383df2661390361e3e9655df1dd8b32b882ec2e8 [file] [log] [blame]
George Rimar6fdac3b2018-07-18 08:19:58 +00001## 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
14# RUN: llvm-readobj -file-headers -elf-output-style GNU \
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)
18
19# RUN: llvm-readobj -file-headers -elf-output-style LLVM \
20# RUN: %p/Inputs/many-sections.elf-x86_64 | FileCheck %s --check-prefix=LLVM1
21# LLVM1: SectionHeaderCount: 0 (5)
22# LLVM1: StringTableSectionIndex: 65535 (3)
23
24## many-sections-stripped.elf-x86_64 is many-sections.elf-x86_64 with
25## e_shoff field set to zero, but not e_shstrndx, to show that
26## this corrupt case is handled correctly.
27
28# RUN: llvm-readobj -file-headers -elf-output-style GNU \
29# RUN: %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=GNU2
30# GNU2: Number of section headers: 0
31# GNU2: Section header string table index: 65535 (corrupt: out of range)
32
33# RUN: llvm-readobj -file-headers -elf-output-style LLVM \
34# RUN: %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=LLVM2
35# LLVM2: SectionHeaderCount: 0
36# LLVM2: StringTableSectionIndex: 65535 (corrupt: out of range)