Skip to content

Commit c3be452

Browse files
committed
[ELF,test] Improve weak-undef-got-plt.s
1 parent 282e471 commit c3be452

File tree

3 files changed

+34
-53
lines changed

3 files changed

+34
-53
lines changed

lld/test/ELF/weak-undef-got-pie.s

Lines changed: 0 additions & 22 deletions
This file was deleted.

lld/test/ELF/weak-undef-got-plt.s

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# REQUIRES: x86
2+
# RUN: rm -rf %t && split-file %s %t && cd %t
3+
# RUN: llvm-mc -filetype=obj -triple=x86_64 -x86-relax-relocations=false a.s -o a.o
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/shared.s -o s.o
5+
# RUN: ld.lld -shared s.o -o s.so
6+
7+
# RUN: ld.lld a.o -o a
8+
# RUN: llvm-readelf -r a | FileCheck %s --check-prefix=NORELOC
9+
# RUN: ld.lld a.o s.so -o as
10+
# RUN: llvm-objdump -dR as | FileCheck %s
11+
12+
# RUN: ld.lld -pie a.o s.so -o as.pie
13+
# RUN: llvm-objdump -dR as.pie | FileCheck %s
14+
15+
# RUN: ld.lld -shared a.o -o a.so
16+
# RUN: llvm-objdump -dR a.so | FileCheck %s
17+
18+
# NORELOC: no relocation
19+
20+
# CHECK: TYPE VALUE
21+
# CHECK-NEXT: R_X86_64_GLOB_DAT foo{{$}}
22+
# CHECK-NEXT: R_X86_64_JUMP_SLOT foo{{$}}
23+
# CHECK-EMPTY:
24+
# CHECK: <_start>:
25+
# CHECK-NEXT: movq {{.*}}(%rip), %rax
26+
# CHECK-NEXT: callq {{.*}} <foo@plt>
27+
28+
#--- a.s
29+
.weak foo
30+
31+
.globl _start
32+
_start:
33+
mov foo@gotpcrel(%rip), %rax
34+
call foo

lld/test/ELF/weak-undef.s

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)