aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/PowerPC/ppc64-localentry.s
blob: 03f760ef86ea95055ca5d9482bd729c095494e59 (plain)
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

# RUN: llvm-mc -triple powerpc64-unknown-unknown -filetype=obj %s | \
# RUN: llvm-readobj -h -r -symbols | FileCheck %s
# RUN: llvm-mc -triple powerpc64le-unknown-unknown -filetype=obj %s | \
# RUN: llvm-readobj -h -r -symbols | FileCheck %s

	.type callee1, @function
callee1:
	nop
	nop
	.localentry callee1, .-callee1
	nop
	nop
	.size callee1, .-callee1

	.type callee2, @function
callee2:
	nop
	nop
	.size callee2, .-callee2

	.type caller, @function
caller:
	bl callee1
	nop
	bl callee2
	nop
	.size caller, .-caller

	.section .text.other
caller_other:
	bl callee1
	nop
	bl callee2
	nop
	.size caller_other, .-caller_other

copy1 = callee1
copy2 = callee2

# Verify that use of .localentry implies ABI version 2
# CHECK: ElfHeader {
# CHECK: Flags [ (0x2)

# Verify that fixups to local function symbols are performed only
# if the target symbol does not use .localentry
# CHECK: Relocations [
# CHECK: Section ({{[0-9]*}}) .rela.text {
# CHECK-NEXT: R_PPC64_REL24 callee1
# CHECK-NEXT: }
# CHECK-NOT: R_PPC64_REL24 callee2
# CHECK: Section ({{[0-9]*}}) .rela.text.other {
# CHECK-NEXT: R_PPC64_REL24 callee1
# CHECK-NEXT: R_PPC64_REL24 .text
# CHECK-NEXT: }

# Verify that .localentry is encoded in the Other field.
# CHECK: Symbols [
# CHECK:       Name: callee1
# CHECK-NEXT:  Value:
# CHECK-NEXT:  Size: 16
# CHECK-NEXT:  Binding: Local
# CHECK-NEXT:  Type: Function
# CHECK-NEXT:  Other: 96
# CHECK-NEXT:  Section: .text
# CHECK:       Name: callee2
# CHECK-NEXT:  Value:
# CHECK-NEXT:  Size: 8
# CHECK-NEXT:  Binding: Local
# CHECK-NEXT:  Type: Function
# CHECK-NEXT:  Other: 0
# CHECK-NEXT:  Section: .text

# Verify that symbol assignment copies the Other bits.
# CHECK:       Name: copy1
# CHECK-NEXT:  Value:
# CHECK-NEXT:  Size: 16
# CHECK-NEXT:  Binding: Local
# CHECK-NEXT:  Type: Function
# CHECK-NEXT:  Other: 96
# CHECK-NEXT:  Section: .text
# CHECK:       Name: copy2
# CHECK-NEXT:  Value:
# CHECK-NEXT:  Size: 8
# CHECK-NEXT:  Binding: Local
# CHECK-NEXT:  Type: Function
# CHECK-NEXT:  Other: 0
# CHECK-NEXT:  Section: .text