• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2# RUN: llvm-mc -triple powerpc64-unknown-unknown -filetype=obj %s | \
3# RUN: llvm-readobj -h -r -symbols | FileCheck %s
4# RUN: llvm-mc -triple powerpc64le-unknown-unknown -filetype=obj %s | \
5# RUN: llvm-readobj -h -r -symbols | FileCheck %s
6
7	.type callee1, @function
8callee1:
9	nop
10	nop
11	.localentry callee1, .-callee1
12	nop
13	nop
14	.size callee1, .-callee1
15
16	.type callee2, @function
17callee2:
18	nop
19	nop
20	.size callee2, .-callee2
21
22	.type caller, @function
23caller:
24	bl callee1
25	nop
26	bl callee2
27	nop
28	.size caller, .-caller
29
30	.section .text.other
31caller_other:
32	bl callee1
33	nop
34	bl callee2
35	nop
36	.size caller_other, .-caller_other
37
38copy1 = callee1
39copy2 = callee2
40
41# Verify that use of .localentry implies ABI version 2
42# CHECK: ElfHeader {
43# CHECK: Flags [ (0x2)
44
45# Verify that fixups to local function symbols are performed only
46# if the target symbol does not use .localentry
47# CHECK: Relocations [
48# CHECK: Section ({{[0-9]*}}) .rela.text {
49# CHECK-NEXT: R_PPC64_REL24 callee1
50# CHECK-NEXT: }
51# CHECK-NOT: R_PPC64_REL24 callee2
52# CHECK: Section ({{[0-9]*}}) .rela.text.other {
53# CHECK-NEXT: R_PPC64_REL24 callee1
54# CHECK-NEXT: R_PPC64_REL24 .text
55# CHECK-NEXT: }
56
57# Verify that .localentry is encoded in the Other field.
58# CHECK: Symbols [
59# CHECK:       Name: callee1
60# CHECK-NEXT:  Value:
61# CHECK-NEXT:  Size: 16
62# CHECK-NEXT:  Binding: Local
63# CHECK-NEXT:  Type: Function
64# CHECK-NEXT:  Other: 96
65# CHECK-NEXT:  Section: .text
66# CHECK:       Name: callee2
67# CHECK-NEXT:  Value:
68# CHECK-NEXT:  Size: 8
69# CHECK-NEXT:  Binding: Local
70# CHECK-NEXT:  Type: Function
71# CHECK-NEXT:  Other: 0
72# CHECK-NEXT:  Section: .text
73
74# Verify that symbol assignment copies the Other bits.
75# CHECK:       Name: copy1
76# CHECK-NEXT:  Value:
77# CHECK-NEXT:  Size: 16
78# CHECK-NEXT:  Binding: Local
79# CHECK-NEXT:  Type: Function
80# CHECK-NEXT:  Other: 96
81# CHECK-NEXT:  Section: .text
82# CHECK:       Name: copy2
83# CHECK-NEXT:  Value:
84# CHECK-NEXT:  Size: 8
85# CHECK-NEXT:  Binding: Local
86# CHECK-NEXT:  Type: Function
87# CHECK-NEXT:  Other: 0
88# CHECK-NEXT:  Section: .text
89
90