File: elf-symbol-types.test

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 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 (87 lines) | stat: -rw-r--r-- 2,050 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Show that llvm-readobj can print the type of symbol for all known symbol types
# and also for unknown types, both in the os/processor specific ranges and not,
# for both GNU and LLVM styles.

# RUN: yaml2obj %s > %t
# RUN: llvm-readobj --symbols %t | FileCheck %s --check-prefix=LLVM
# RUN: llvm-readelf --symbols %t | FileCheck %s --check-prefix=GNU

# LLVM: Name: notype
# LLVM: Type: None
# LLVM: Name: object
# LLVM: Type: Object
# LLVM: Name: func
# LLVM: Type: Function
# LLVM: Name: .text
# LLVM: Type: Section
# LLVM: Name: file
# LLVM: Type: File
# LLVM: Name: common
# LLVM: Type: Common
# LLVM: Name: tls
# LLVM: Type: TLS
# LLVM: Name: gnu_ifunc
# LLVM: Type: GNU_IFunc
# LLVM: Name: os_specific
# LLVM: Type: 0xB
# LLVM: Name: proc_specific
# LLVM: Type: 0xD
# LLVM: Name: unknown
# LLVM: Type: 0x7

# GNU: NOTYPE  {{.*}} notype
# GNU: OBJECT  {{.*}} object
# GNU: FUNC    {{.*}} func
# GNU: SECTION {{.*}} .text
# GNU: FILE    {{.*}} file
# GNU: COMMON  {{.*}} common
# GNU: TLS     {{.*}} tls
# GNU: IFUNC   {{.*}} gnu_ifunc
# GNU: b       {{.*}} os_specific
# GNU: d       {{.*}} proc_specific
# GNU: 7       {{.*}} unknown

!ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_X86_64
Sections:
  - Name: .text
    Type: SHT_PROGBITS
Symbols:
  - Name:    notype
    Type:    STT_NOTYPE
    Binding: STB_GLOBAL
  - Name:    object
    Type:    STT_OBJECT
    Binding: STB_GLOBAL
  - Name:    func
    Type:    STT_FUNC
    Binding: STB_GLOBAL
  - Name:    .text
    Type:    STT_SECTION
    Section: .text
    Binding: STB_GLOBAL
  - Name:    file
    Type:    STT_FILE
    Binding: STB_GLOBAL
  - Name:    common
    Type:    STT_COMMON
    Binding: STB_GLOBAL 
  - Name:    tls
    Type:    STT_TLS
    Binding: STB_GLOBAL
  - Name:    gnu_ifunc
    Type:    STT_GNU_IFUNC
    Binding: STB_GLOBAL
  - Name:    os_specific
    Type:    11
    Binding: STB_GLOBAL
  - Name:    proc_specific
    Type:    13
    Binding: STB_GLOBAL
  - Name:    unknown
    Type:    7
    Binding: STB_GLOBAL