testsuite: adapt to new --debug command line option
[binutils-gdb.git] / ld / testsuite / ld-powerpc / pcrelopt.s
blob4b41436cc3a4864bd6bcfacfd024db86682e8591
1 .text
2 .globl _start
3 _start:
4 # original PCREL_OPT definition, with second insn immediately after first
5 pld 9,sym@got@pcrel
6 .reloc .-8,R_PPC64_PCREL_OPT,0
7 lbz 3,0(9)
9 # but we now allow an offset to the second insn
10 pld 22,sym@got@pcrel
11 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
12 nop
13 0: lhz 4,0(22)
15 # in fact, it can even be before the "first" insn
16 0: lha 3,0(9)
17 pld 9,sym@got@pcrel
18 .reloc .-8,R_PPC64_PCREL_OPT,0b-(.-8)
19 bne 0b
21 # and of course, other local labels work
22 pld 9,sym@got@pcrel
23 .reloc .-8,R_PPC64_PCREL_OPT,.L1-(.-8)
24 .L1: lwz 3,0(9)
26 pld 9,sym@got@pcrel
27 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
28 0: lwa 3,0(9)
30 pld 9,sym@got@pcrel
31 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
32 0: ld 3,0(9)
34 pld 9,sym@got@pcrel
35 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
36 0: lq 14,0(9)
38 pld 9,sym@got@pcrel
39 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
40 0: lfs 1,0(9)
42 pld 9,sym@got@pcrel
43 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
44 0: lfd 1,0(9)
46 pld 9,sym@got@pcrel
47 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
48 0: lxsd 30,0(9)
50 pld 9,sym@got@pcrel
51 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
52 0: lxssp 31,0(9)
54 pld 9,sym@got@pcrel
55 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
56 0: lxv 63,0(9)
58 pld 9,sym@got@pcrel
59 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
60 0: lxv 0,0(9)
62 pld 9,sym@got@pcrel
63 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
64 0: stb 3,0(9)
66 pld 9,sym@got@pcrel
67 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
68 0: sth 3,0(9)
70 pld 9,sym@got@pcrel
71 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
72 0: stw 3,0(9)
74 pld 9,sym@got@pcrel
75 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
76 0: std 3,0(9)
78 pld 9,sym@got@pcrel
79 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
80 0: stq 14,0(9)
82 pld 9,sym@got@pcrel
83 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
84 0: stfd 1,0(9)
86 pld 9,sym@got@pcrel
87 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
88 0: stfs 2,0(9)
90 pld 9,sym@got@pcrel
91 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
92 0: stxsd 30,0(9)
94 pld 9,sym@got@pcrel
95 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
96 0: stxssp 31,0(9)
98 pld 9,sym@got@pcrel
99 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
100 0: stxv 63,0(9)
102 pld 9,sym@got@pcrel
103 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
104 0: stxv 0,0(9)
106 #offsets are allowed too
107 pld 9,sym@got@pcrel
109 lbz 3,0x1234(9)
110 .reloc 0b-8,R_PPC64_PCREL_OPT,(.-4)-(0b-8)
112 #and prefix insns as the second insn
113 pld 9,sym@got@pcrel
115 plq 4,0x12345678(9)
116 .reloc 0b-8,R_PPC64_PCREL_OPT,(.-8)-(0b-8)
118 # This should not optimize
119 .extern i
120 .type i,@object
121 pld 9,i@got@pcrel
122 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
123 0: ld 0,0(9)
125 # and this should edit from GOT indirect to GOT relative
126 # ie. change the pld to paddi, leaving the lbz as is.
127 pld 7,sym@got@pcrel
128 lbz 6,0(7)
130 pld 9,sym@got@pcrel
131 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
132 0: lxvp 62,0(9)
134 pld 9,sym@got@pcrel
135 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
136 0: lxvp 0,0(9)
138 pld 9,sym@got@pcrel
139 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
140 0: stxvp 62,0(9)
142 pld 9,sym@got@pcrel
143 .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8)
144 0: stxvp 0,0(9)
146 .data
147 sym: .space 32