File: duplicate-symbol-names.yaml

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (97 lines) | stat: -rw-r--r-- 2,391 bytes parent folder | download | duplicates (21)
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
88
89
90
91
92
93
94
95
96
97
## Check that yaml2obj is able to produce an object from YAML
## containing symbols with duplicate names (but different name suffixes).

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

# CASE1: Name: localfoo (1)
# CASE1: Name: localfoo (1)

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_REL
Symbols:
  - Name: localfoo
  - Name: 'localfoo (1)'

## Check that yaml2obj reports an error when we have
## symbols with equal names and suffixes.

# RUN: not yaml2obj --docnum=2 %s 2>&1| FileCheck %s --check-prefix=CASE2
# CASE2-COUNT-2: error: repeated symbol name: 'localfoo (1)'

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_REL
Symbols:
  - Name: 'localfoo (1)'
  - Name: 'localfoo (1)'
  - Name: 'localfoo (1)'

## Check that yaml2obj reports an error when we have
## symbols without suffixes in the names and their
## names are equal.

# RUN: not yaml2obj --docnum=3 %s 2>&1| FileCheck %s --check-prefix=CASE3
# CASE3: error: repeated symbol name: 'localfoo'
# CASE3: error: repeated symbol name: 'localfoo'

--- !ELF
FileHeader:
  Class: ELFCLASS64
  Data:  ELFDATA2LSB
  Type:  ET_REL
Symbols:
  - Name: localfoo
  - Name: localfoo
  - Name: localfoo

## Check that yaml2obj can produce correct relocations that
## reference symbols with name suffixes.

# RUN: yaml2obj --docnum=4 %s -o %t4
# RUN: llvm-readobj -r --expand-relocs %t4 | FileCheck %s --check-prefix=CASE4

# CASE4:      Relocations [
# CASE4-NEXT:   Section {{.*}} .rela.text {
# CASE4-NEXT:     Relocation {
# CASE4-NEXT:       Offset: 0x0
# CASE4-NEXT:       Type: R_X86_64_NONE
# CASE4-NEXT:       Symbol: foo (1)
# CASE4-NEXT:       Addend: 0x0
# CASE4-NEXT:     }
# CASE4-NEXT:     Relocation {
# CASE4-NEXT:       Offset: 0x1
# CASE4-NEXT:       Type: R_X86_64_NONE
# CASE4-NEXT:       Symbol: foo (2)
# CASE4-NEXT:       Addend: 0x0
# CASE4-NEXT:     }
# CASE4-NEXT:   }
# CASE4-NEXT: ]

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_X86_64
Sections:
  - Name: .text
    Type: SHT_PROGBITS
  - Name: .rela.text
    Type: SHT_RELA
    Info: .text
    Link: .symtab
    Relocations:
      - Type:   R_X86_64_NONE
        Symbol: foo
      - Offset: 0x1
        Type:   R_X86_64_NONE
        Symbol: 'foo (1)'
Symbols:
  - Name: foo
  - Name: 'foo (1)'