File tree 1 file changed +21
-8
lines changed
lld/test/ELF/linkerscript
1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change 1
1
# REQUIRES: x86
2
2
## Test relocations referencing symbols defined relative to sections discarded by /DISCARD/.
3
3
4
- # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
5
- # RUN: echo "SECTIONS { /DISCARD/ : { *(.aaa*) } }" > %t.lds
6
- # RUN: ld.lld -T %t.lds %t.o -z undefs -o /dev/null 2>&1 | count 0
7
- # RUN: ld.lld -T %t.lds %t.o -o /dev/null 2>&1 | count 0
8
- # RUN: ld.lld -r -T %t.lds %t.o -o /dev/null 2>&1 | count 0
4
+ # RUN: rm -rf %t && split-file %s %t && cd %t
5
+ # RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
6
+ # RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o
7
+ # RUN: ld.lld -T a.lds a.o b.o -z undefs -o /dev/null 2>&1 | count 0
8
+ # RUN: ld.lld -T a.lds a.o b.o -o /dev/null 2>&1 | count 0
9
+ # RUN: ld.lld -r -T a.lds a.o b.o -o /dev/null 2>&1 | count 0
9
10
11
+ #--- a.s
10
12
.globl _start
11
13
_start:
12
14
13
15
.section .aaa ,"a"
14
- .globl global
15
- .weak weak
16
+ .globl global, weakref1
17
+ .weak weak, weakref2
16
18
global:
17
19
weak:
20
+ weakref1:
21
+ weakref2:
18
22
.quad 0
19
23
20
- .section .zzz, "a "
24
+ .section .bbb, "aw "
21
25
.quad .aaa
26
+
27
+ #--- b.s
28
+ .weak weakref1, weakref2
29
+ .section .data ,"aw"
22
30
.quad global
23
31
.quad weak
32
+ .quad weakref1
33
+ .quad weakref2
34
+
35
+ #--- a.lds
36
+ SECTIONS { /DISCARD/ : { *(.aaa ) } }
You can’t perform that action at this time.
0 commit comments