1 ## Check that obj2yaml is able to produce YAML from
2 ## an object containing symbols and sections with duplicate
3 ## names and produces same-named sections and symbols
4 ## with distinguishing suffixes.
6 # RUN: yaml2obj --docnum=1 %s -o %t1
7 # RUN: llvm-readobj -s -t %t1 | FileCheck %s
16 # CHECK: Name: localfoo (
17 # CHECK: Name: localfoo (
18 # CHECK: Name: localfoo (
19 # CHECK: Name: localbar (
20 # CHECK: Name: localbar (
21 # CHECK: Name: localbar (
23 # RUN: obj2yaml %t1 | FileCheck %s --check-prefix=CASE1
26 # CASE1-NEXT: FileHeader:
27 # CASE1-NEXT: Class: ELFCLASS64
28 # CASE1-NEXT: Data: ELFDATA2LSB
29 # CASE1-NEXT: Type: ET_REL
30 # CASE1-NEXT: Sections:
31 # CASE1-NEXT: - Name: .foo
32 # CASE1-NEXT: Type: SHT_PROGBITS
33 # CASE1-NEXT: - Name: '.foo (1)'
34 # CASE1-NEXT: Type: SHT_PROGBITS
35 # CASE1-NEXT: - Name: '.foo (2)'
36 # CASE1-NEXT: Type: SHT_PROGBITS
37 # CASE1-NEXT: - Name: .bar
38 # CASE1-NEXT: Type: SHT_PROGBITS
39 # CASE1-NEXT: - Name: '.bar (1)'
40 # CASE1-NEXT: Type: SHT_PROGBITS
41 # CASE1-NEXT: - Name: '.bar (2)'
42 # CASE1-NEXT: Type: SHT_PROGBITS
43 # CASE1-NEXT: Symbols:
44 # CASE1-NEXT: - Name: localfoo
45 # CASE1-NEXT: - Name: 'localfoo (1)'
46 # CASE1-NEXT: - Name: 'localfoo (2)'
47 # CASE1-NEXT: - Name: localbar
48 # CASE1-NEXT: - Name: 'localbar (1)'
49 # CASE1-NEXT: - Name: 'localbar (2)'
62 - Name: '.foo (random_tag)'
68 - Name: '.bar (random_tag)'
71 - Name: 'localfoo (111)'
72 - Name: 'localfoo (222)'
73 - Name: 'localfoo (random_tag)'
74 - Name: 'localbar (333)'
75 - Name: 'localbar (444)'
76 - Name: 'localbar (random_tag)'
78 ## Check we can refer to symbols with the same
79 ## name from relocations.
81 # RUN: yaml2obj --docnum=2 %s -o %t2
82 # RUN: obj2yaml %t2 | FileCheck %s --check-prefix=CASE2
85 # CASE2-NEXT: - Symbol: 'foo (1)'
86 # CASE2-NEXT: Type: R_X86_64_PC32
87 # CASE2-NEXT: - Offset: 0x4
88 # CASE2-NEXT: Symbol: foo
89 # CASE2-NEXT: Type: R_X86_64_PC32
90 # CASE2-NEXT: Symbols:
91 # CASE2-NEXT: - Name: foo
92 # CASE2-NEXT: - Name: 'foo (1)'
109 - Type: R_X86_64_PC32
111 - Type: R_X86_64_PC32
118 ## Check obj2yaml does not add a suffix to a name if the
119 ## symbol is in .symtab and .dynsym at the same time.
121 # RUN: yaml2obj --docnum=3 %s -o %t3
122 # RUN: obj2yaml %t3 | FileCheck %s --check-prefix=CASE3
125 # CASE3-NEXT: - Name: foo
126 # CASE3-NEXT: Binding: STB_GLOBAL
127 # CASE3-NEXT: DynamicSymbols:
128 # CASE3-NEXT: - Name: foo
129 # CASE3-NEXT: Binding: STB_GLOBAL