dynamic-list-preempt.s
2.24 KB
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
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: echo "{ foo; zed; };" > %t.list
# RUN: echo "{ global: foo; bar; local: *; };" > %t.vers
# RUN: ld.lld --hash-style=sysv -fatal-warnings -dynamic-list %t.list -version-script %t.vers -shared %t.o -o %t.so
# RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=RELOCS %s
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=DYNSYMS %s
# RUN: echo "V1 { global: foo; bar; local: *; };" > %t.vers
# RUN: ld.lld --hash-style=sysv -fatal-warnings -dynamic-list %t.list -version-script %t.vers -shared %t.o -o %t.so
# RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=RELOCS %s
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=DYNSYMS %s
# RELOCS: Relocations [
# RELOCS-NEXT: Section ({{.*}}) .rela.plt {
# RELOCS-NEXT: R_X86_64_JUMP_SLOT foo{{.*}} 0x0
# RELOCS-NEXT: R_X86_64_JUMP_SLOT ext 0x0
# RELOCS-NEXT: }
# RELOCS-NEXT: ]
# DYNSYMS: DynamicSymbols [
# DYNSYMS-NEXT: Symbol {
# DYNSYMS-NEXT: Name:
# DYNSYMS-NEXT: Value: 0x0
# DYNSYMS-NEXT: Size: 0
# DYNSYMS-NEXT: Binding: Local
# DYNSYMS-NEXT: Type: None
# DYNSYMS-NEXT: Other: 0
# DYNSYMS-NEXT: Section: Undefined
# DYNSYMS-NEXT: }
# DYNSYMS-NEXT: Symbol {
# DYNSYMS-NEXT: Name: bar
# DYNSYMS-NEXT: Value:
# DYNSYMS-NEXT: Size:
# DYNSYMS-NEXT: Binding: Global
# DYNSYMS-NEXT: Type:
# DYNSYMS-NEXT: Other:
# DYNSYMS-NEXT: Section:
# DYNSYMS-NEXT: }
# DYNSYMS-NEXT: Symbol {
# DYNSYMS-NEXT: Name: ext
# DYNSYMS-NEXT: Value:
# DYNSYMS-NEXT: Size:
# DYNSYMS-NEXT: Binding: Global
# DYNSYMS-NEXT: Type:
# DYNSYMS-NEXT: Other:
# DYNSYMS-NEXT: Section:
# DYNSYMS-NEXT: }
# DYNSYMS-NEXT: Symbol {
# DYNSYMS-NEXT: Name: foo
# DYNSYMS-NEXT: Value:
# DYNSYMS-NEXT: Size:
# DYNSYMS-NEXT: Binding: Global
# DYNSYMS-NEXT: Type:
# DYNSYMS-NEXT: Other:
# DYNSYMS-NEXT: Section:
# DYNSYMS-NEXT: }
# DYNSYMS-NEXT: ]
.globl foo
foo:
ret
.globl bar
bar:
ret
.globl baz
baz:
ret
.globl zed
zed:
ret
call foo@PLT
call bar@PLT
call baz@PLT
call zed@PLT
call ext@PLT