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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
# Tests that linker throws an error for an undefined symbol in the section
# group, which is the same as the signature in the next input file.
# comdat1.s
# ------------
# .section .foo,"axG",@progbits,g1,comdat
# .word g1
#comdat2.s
#-----------
# .global g1
# .section .bar,"axG",@progbits,g1,comdat
#g2:
# nop
# .section .car,"axG",@progbits,g1,comdat
#g3:
# nop
#
#RUN: yaml2obj -format=elf -docnum 1 %s -o %t.group1a.o
#RUN: yaml2obj -format=elf -docnum 2 %s -o %t.group1b.o
#RUN: lld -flavor old-gnu -target x86_64 %t.group1a.o %t.group1b.o \
#RUN: --noinhibit-exec -o %t2.out 2>&1 | FileCheck %s
#CHECK: Undefined symbol: {{.*}} g1
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
OSABI: ELFOSABI_GNU
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .group
Type: SHT_GROUP
Link: .symtab
AddressAlign: 0x0000000000000004
Info: g1
Members:
- SectionOrType: GRP_COMDAT
- SectionOrType: .foo
- SectionOrType: .rela.foo
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x0000000000000004
Content: ''
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x0000000000000004
Content: ''
- Name: .bss
Type: SHT_NOBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x0000000000000004
- Name: .foo
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
AddressAlign: 0x0000000000000001
Content: '0000'
- Name: .rela.foo
Type: SHT_RELA
Flags: [ SHF_GROUP ]
Link: .symtab
AddressAlign: 0x0000000000000008
Info: .foo
Relocations:
- Offset: 0x0000000000000000
Symbol: g1
Type: R_X86_64_16
Symbols:
Local:
- Name: .text
Type: STT_SECTION
Section: .text
- Name: .data
Type: STT_SECTION
Section: .data
- Name: .bss
Type: STT_SECTION
Section: .bss
- Name: .foo
Type: STT_SECTION
Section: .foo
- Name: .group
Type: STT_SECTION
Section: .group
Global:
- Name: g1
...
---
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
OSABI: ELFOSABI_GNU
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .group
Type: SHT_GROUP
Link: .symtab
AddressAlign: 0x0000000000000004
Info: g1
Members:
- SectionOrType: GRP_COMDAT
- SectionOrType: .bar
- SectionOrType: .car
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x0000000000000004
Content: ''
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x0000000000000004
Content: ''
- Name: .bss
Type: SHT_NOBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
AddressAlign: 0x0000000000000004
- Name: .bar
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
AddressAlign: 0x0000000000000001
Content: '90'
- Name: .car
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
AddressAlign: 0x0000000000000001
Content: '90'
Symbols:
Local:
- Name: g2
Section: .bar
- Name: g3
Section: .car
- Name: .text
Type: STT_SECTION
Section: .text
- Name: .data
Type: STT_SECTION
Section: .data
- Name: .bss
Type: STT_SECTION
Section: .bss
- Name: .bar
Type: STT_SECTION
Section: .bar
- Name: .car
Type: STT_SECTION
Section: .car
- Name: .group
Type: STT_SECTION
Section: .group
Global:
- Name: g1
Section: .group
...
|