File: many-sections.s

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8~deb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 733,456 kB
  • sloc: cpp: 3,776,651; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; ruby: 156
file content (37 lines) | stat: -rw-r--r-- 1,943 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## many-sections.elf-x86_64 is a file that was generated to simulate
## an object with more than ~65k sections. When an ELF object
## has SHN_LORESERVE (0xff00) or more sections, its e_shnum field
## should be zero and sh_size of the section header at index 0 is used
## to store the value. If the section name string table section index is
## greater than or equal to SHN_LORESERVE, then e_shstrndx field
## should have the value of SHN_XINDEX and sh_link of the section header
## at index 0 is used to store the value.
##
## many-sections.elf-x86_64 has few sections to save disk
## space, but its e_shnum, e_shstrndx, sh_size and sh_link fields are set
## according to the above description, so that we can test the dumper.

# RUN: llvm-readobj -file-headers -sections -elf-output-style GNU \
# RUN:   %p/Inputs/many-sections.elf-x86_64 | FileCheck %s --check-prefix=GNU1
# GNU1: Number of section headers:         0 (5)
# GNU1: Section header string table index: 65535 (3)
# GNU1: There are 5 section headers, starting at offset 0xb8

# RUN: llvm-readobj -file-headers -elf-output-style LLVM \
# RUN:   %p/Inputs/many-sections.elf-x86_64 | FileCheck %s --check-prefix=LLVM1
# LLVM1: SectionHeaderCount: 0 (5)
# LLVM1: StringTableSectionIndex: 65535 (3)

## many-sections-stripped.elf-x86_64 is many-sections.elf-x86_64 with
## e_shoff field set to zero, but not e_shstrndx, to show that
## this corrupt case is handled correctly.

# RUN: llvm-readobj -file-headers -elf-output-style GNU \
# RUN:   %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=GNU2
# GNU2: Number of section headers:         0
# GNU2: Section header string table index: 65535 (corrupt: out of range)

# RUN: llvm-readobj -file-headers -elf-output-style LLVM \
# RUN:   %p/Inputs/many-sections-stripped.elf-x86_64 | FileCheck %s --check-prefix=LLVM2
# LLVM2: SectionHeaderCount: 0
# LLVM2: StringTableSectionIndex: 65535 (corrupt: out of range)