File: llvm-addrsig-section.yaml

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (80 lines) | stat: -rw-r--r-- 2,251 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
## Check how obj2yaml dumps the SHT_LLVM_ADDRSIG section.

## Check that when possible obj2yaml tries to produce the "Name" tag when
## dumping entries of the SHT_LLVM_ADDRSIG section. It falls back to producing
## the "Index" tag when it can't match a symbol index with a symbol table entry.

# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: obj2yaml %t1 | FileCheck %s --check-prefix=NAME

# NAME:      - Name:    .llvm_addrsig
# NAME-NEXT:   Type:    SHT_LLVM_ADDRSIG
# NAME-NEXT:   Link:    .symtab
# NAME-NEXT:   Symbols: [ foo, bar, '3', '4294967295' ]
# NAME:      - Name: .llvm_addrsig_unlinked
# NAME-NEXT:   Type: SHT_LLVM_ADDRSIG
# NAME-NEXT:   Symbols: [ '1', '2', '3', '4294967295' ]

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .llvm_addrsig
    Type: SHT_LLVM_ADDRSIG
    Symbols: [ 1, 2, 3, 0xFFFFFFFF ]
  - Name: .llvm_addrsig_unlinked
    Type: SHT_LLVM_ADDRSIG
    Link: 0
    Symbols: [ 1, 2, 3, 0xFFFFFFFF ]
Symbols:
  - Name:    foo
    Type:    STT_FUNC
    Binding: STB_GLOBAL
  - Name:    bar
    Type:    STT_FUNC
    Binding: STB_GLOBAL

## Check that obj2yaml dumps the SHT_LLVM_ADDRSIG section
## data using the "Content" tag when at least one of the entries is broken,
## e.g. because the entry contains a malformed uleb128 value.

# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: obj2yaml %t2 | FileCheck %s --check-prefix=INVALID-ENTRY

# INVALID-ENTRY:      - Name:    .llvm_addrsig
# INVALID-ENTRY-NEXT:   Type:    SHT_LLVM_ADDRSIG
# INVALID-ENTRY-NEXT:   Content: FFFFFFFFFF

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .llvm_addrsig
    Type: SHT_LLVM_ADDRSIG
    Content: "FFFFFFFFFF"

## obj2yaml produces a "Symbols" tag when describing an empty SHT_LLVM_ADDRSIG section.

# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: obj2yaml %t3 | FileCheck %s --check-prefix=EMPTY

# EMPTY:      - Name:    .llvm_addrsig
# EMPTY-NEXT:   Type:    SHT_LLVM_ADDRSIG
# EMPTY-NEXT:   Symbols: [ ]

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .llvm_addrsig
    Type: SHT_LLVM_ADDRSIG
    Content: ""