Skip to content

Commit 4fb49f4

Browse files
committed
[ELF][test] Test relocations referencing symbols relative to sections discarded by /DISCARD/
1 parent bb6a98c commit 4fb49f4

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed
Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
# REQUIRES: x86
2-
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3-
# RUN: echo "SECTIONS { /DISCARD/ : { *(.aaa*) } }" > %t.script
4-
# RUN: ld.lld -o %t1 --script %t.script %t
5-
# RUN: llvm-objdump --section-headers %t1 | FileCheck %s
2+
## Test relocations referencing symbols defined relative to sections discarded by /DISCARD/.
63

7-
# CHECK-NOT: .aaa
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
9+
10+
.globl _start
11+
_start:
812

913
.section .aaa,"a"
10-
aab:
14+
.globl global
15+
.weak weak
16+
global:
17+
weak:
1118
.quad 0
1219

1320
.section .zzz,"a"
14-
.quad aab
21+
.quad .aaa
22+
.quad global
23+
.quad weak

0 commit comments

Comments
 (0)