File: implicit-sections-types.test

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (69 lines) | stat: -rw-r--r-- 1,736 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## Here we check the types set for implicit sections
## in different cases.

## Check the types set by default in case sections were implicitly
## added and not described in the YAML.

# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-readobj -S %t1 | FileCheck %s --check-prefix=CASE1

# CASE1:      Name: .symtab
# CASE1-NEXT: Type: SHT_SYMTAB
# CASE1:      Name: .strtab
# CASE1-NEXT: Type: SHT_STRTAB
# CASE1:      Name: .shstrtab
# CASE1-NEXT: Type: SHT_STRTAB
# CASE1:      Name: .dynsym
# CASE1-NEXT: Type: SHT_DYNSYM
# CASE1:      Name: .dynstr
# CASE1-NEXT: Type: SHT_STRTAB

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
## Needed to force the creation of the .dynsym and .dynstr.
DynamicSymbols:
  - Name:    foo
  - Binding: STB_GLOBAL

## Check we can set any arbitrary types when describing sections
## that are usually implicit.

# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: llvm-readobj -S %t2 | FileCheck %s --check-prefix=CASE2

# CASE2:      Name: .symtab
# CASE2-NEXT: Type: SHT_DYNAMIC
# CASE2:      Name: .strtab
# CASE2-NEXT: Type: SHT_RELA
# CASE2:      Name: .shstrtab
# CASE2-NEXT: Type: SHT_PROGBITS
# CASE2:      Name: .dynsym
# CASE2-NEXT: Type: SHT_NOTE
# CASE2:      Name: .dynstr
# CASE2-NEXT: Type: SHT_NOBITS

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .symtab
    Type: SHT_DYNAMIC
  - Name: .strtab
    Type: SHT_RELA
  - Name: .shstrtab
    Type: SHT_PROGBITS
  - Name: .dynsym
    Type: SHT_NOTE
  - Name: .dynstr
    Type: SHT_NOBITS
## Needed to set the proper content size for .symtab, so
## that llvm-readobj can dump this section.
Symbols:
  - Name: foo