Commit | Line | Data |
---|---|---|
4a421c53 AM |
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) | |
8 | ||
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) | |
14 | ||
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 | |
20 | ||
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) | |
25 | ||
26 | pld 9,sym@got@pcrel | |
27 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
28 | 0: lwa 3,0(9) | |
29 | ||
30 | pld 9,sym@got@pcrel | |
31 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
32 | 0: ld 3,0(9) | |
33 | ||
34 | pld 9,sym@got@pcrel | |
35 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
36 | 0: lq 14,0(9) | |
37 | ||
38 | pld 9,sym@got@pcrel | |
39 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
40 | 0: lfs 1,0(9) | |
41 | ||
42 | pld 9,sym@got@pcrel | |
43 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
44 | 0: lfd 1,0(9) | |
45 | ||
46 | pld 9,sym@got@pcrel | |
47 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
48 | 0: lxsd 30,0(9) | |
49 | ||
50 | pld 9,sym@got@pcrel | |
51 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
52 | 0: lxssp 31,0(9) | |
53 | ||
54 | pld 9,sym@got@pcrel | |
55 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
56 | 0: lxv 63,0(9) | |
57 | ||
58 | pld 9,sym@got@pcrel | |
59 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
60 | 0: lxv 0,0(9) | |
61 | ||
62 | pld 9,sym@got@pcrel | |
63 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
64 | 0: stb 3,0(9) | |
65 | ||
66 | pld 9,sym@got@pcrel | |
67 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
68 | 0: sth 3,0(9) | |
69 | ||
70 | pld 9,sym@got@pcrel | |
71 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
72 | 0: stw 3,0(9) | |
73 | ||
74 | pld 9,sym@got@pcrel | |
75 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
76 | 0: std 3,0(9) | |
77 | ||
78 | pld 9,sym@got@pcrel | |
79 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
80 | 0: stq 14,0(9) | |
81 | ||
82 | pld 9,sym@got@pcrel | |
83 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
84 | 0: stfd 1,0(9) | |
85 | ||
86 | pld 9,sym@got@pcrel | |
87 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
88 | 0: stfs 2,0(9) | |
89 | ||
90 | pld 9,sym@got@pcrel | |
91 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
92 | 0: stxsd 30,0(9) | |
93 | ||
94 | pld 9,sym@got@pcrel | |
95 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
96 | 0: stxssp 31,0(9) | |
97 | ||
98 | pld 9,sym@got@pcrel | |
99 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
100 | 0: stxv 63,0(9) | |
101 | ||
102 | pld 9,sym@got@pcrel | |
103 | .reloc .-8,R_PPC64_PCREL_OPT,0f-(.-8) | |
104 | 0: stxv 0,0(9) | |
105 | ||
77486630 AM |
106 | #offsets are allowed too |
107 | pld 9,sym@got@pcrel | |
108 | 0: | |
109 | lbz 3,0x1234(9) | |
110 | .reloc 0b-8,R_PPC64_PCREL_OPT,(.-4)-(0b-8) | |
111 | ||
112 | #and prefix insns as the second insn | |
113 | pld 9,sym@got@pcrel | |
114 | 0: | |
115 | plq 4,0x12345678(9) | |
116 | .reloc 0b-8,R_PPC64_PCREL_OPT,(.-8)-(0b-8) | |
117 | ||
4a421c53 AM |
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) | |
124 | ||
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) | |
129 | ||
130 | .data | |
131 | sym: .space 32 |