]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - ELF/Arch/X86.cpp
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / ELF / Arch / X86.cpp
1 //===- X86.cpp ------------------------------------------------------------===//
2 //
3 //                             The LLVM Linker
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "InputFiles.h"
11 #include "Symbols.h"
12 #include "SyntheticSections.h"
13 #include "Target.h"
14 #include "lld/Common/ErrorHandler.h"
15 #include "llvm/Support/Endian.h"
16
17 using namespace llvm;
18 using namespace llvm::support::endian;
19 using namespace llvm::ELF;
20 using namespace lld;
21 using namespace lld::elf;
22
23 namespace {
24 class X86 : public TargetInfo {
25 public:
26   X86();
27   RelExpr getRelExpr(RelType Type, const Symbol &S,
28                      const uint8_t *Loc) const override;
29   int64_t getImplicitAddend(const uint8_t *Buf, RelType Type) const override;
30   void writeGotPltHeader(uint8_t *Buf) const override;
31   RelType getDynRel(RelType Type) const override;
32   void writeGotPlt(uint8_t *Buf, const Symbol &S) const override;
33   void writeIgotPlt(uint8_t *Buf, const Symbol &S) const override;
34   void writePltHeader(uint8_t *Buf) const override;
35   void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr,
36                 int32_t Index, unsigned RelOff) const override;
37   void relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const override;
38
39   RelExpr adjustRelaxExpr(RelType Type, const uint8_t *Data,
40                           RelExpr Expr) const override;
41   void relaxTlsGdToIe(uint8_t *Loc, RelType Type, uint64_t Val) const override;
42   void relaxTlsGdToLe(uint8_t *Loc, RelType Type, uint64_t Val) const override;
43   void relaxTlsIeToLe(uint8_t *Loc, RelType Type, uint64_t Val) const override;
44   void relaxTlsLdToLe(uint8_t *Loc, RelType Type, uint64_t Val) const override;
45 };
46 } // namespace
47
48 X86::X86() {
49   CopyRel = R_386_COPY;
50   GotRel = R_386_GLOB_DAT;
51   PltRel = R_386_JUMP_SLOT;
52   IRelativeRel = R_386_IRELATIVE;
53   RelativeRel = R_386_RELATIVE;
54   TlsGotRel = R_386_TLS_TPOFF;
55   TlsModuleIndexRel = R_386_TLS_DTPMOD32;
56   TlsOffsetRel = R_386_TLS_DTPOFF32;
57   GotEntrySize = 4;
58   GotPltEntrySize = 4;
59   PltEntrySize = 16;
60   PltHeaderSize = 16;
61   TlsGdRelaxSkip = 2;
62   TrapInstr = 0xcccccccc; // 0xcc = INT3
63 }
64
65 static bool hasBaseReg(uint8_t ModRM) { return (ModRM & 0xc7) != 0x5; }
66
67 RelExpr X86::getRelExpr(RelType Type, const Symbol &S,
68                         const uint8_t *Loc) const {
69   switch (Type) {
70   case R_386_8:
71   case R_386_16:
72   case R_386_32:
73   case R_386_TLS_LDO_32:
74     return R_ABS;
75   case R_386_TLS_GD:
76     return R_TLSGD_GOT_FROM_END;
77   case R_386_TLS_LDM:
78     return R_TLSLD_GOT_FROM_END;
79   case R_386_PLT32:
80     return R_PLT_PC;
81   case R_386_PC8:
82   case R_386_PC16:
83   case R_386_PC32:
84     return R_PC;
85   case R_386_GOTPC:
86     return R_GOTONLY_PC_FROM_END;
87   case R_386_TLS_IE:
88     return R_GOT;
89   case R_386_GOT32:
90   case R_386_GOT32X:
91     // These relocations are arguably mis-designed because their calculations
92     // depend on the instructions they are applied to. This is bad because we
93     // usually don't care about whether the target section contains valid
94     // machine instructions or not. But this is part of the documented ABI, so
95     // we had to implement as the standard requires.
96     //
97     // x86 does not support PC-relative data access. Therefore, in order to
98     // access GOT contents, a GOT address needs to be known at link-time
99     // (which means non-PIC) or compilers have to emit code to get a GOT
100     // address at runtime (which means code is position-independent but
101     // compilers need to emit extra code for each GOT access.) This decision
102     // is made at compile-time. In the latter case, compilers emit code to
103     // load an GOT address to a register, which is usually %ebx.
104     //
105     // So, there are two ways to refer to symbol foo's GOT entry: foo@GOT or
106     // foo@GOT(%reg).
107     //
108     // foo@GOT is not usable in PIC. If we are creating a PIC output and if we
109     // find such relocation, we should report an error. foo@GOT is resolved to
110     // an *absolute* address of foo's GOT entry, because both GOT address and
111     // foo's offset are known. In other words, it's G + A.
112     //
113     // foo@GOT(%reg) needs to be resolved to a *relative* offset from a GOT to
114     // foo's GOT entry in the table, because GOT address is not known but foo's
115     // offset in the table is known. It's G + A - GOT.
116     //
117     // It's unfortunate that compilers emit the same relocation for these
118     // different use cases. In order to distinguish them, we have to read a
119     // machine instruction.
120     //
121     // The following code implements it. We assume that Loc[0] is the first
122     // byte of a displacement or an immediate field of a valid machine
123     // instruction. That means a ModRM byte is at Loc[-1]. By taking a look at
124     // the byte, we can determine whether the instruction is register-relative
125     // (i.e. it was generated for foo@GOT(%reg)) or absolute (i.e. foo@GOT).
126     return hasBaseReg(Loc[-1]) ? R_GOT_FROM_END : R_GOT;
127   case R_386_TLS_GOTIE:
128     return R_GOT_FROM_END;
129   case R_386_GOTOFF:
130     return R_GOTREL_FROM_END;
131   case R_386_TLS_LE:
132     return R_TLS;
133   case R_386_TLS_LE_32:
134     return R_NEG_TLS;
135   case R_386_NONE:
136     return R_NONE;
137   default:
138     return R_INVALID;
139   }
140 }
141
142 RelExpr X86::adjustRelaxExpr(RelType Type, const uint8_t *Data,
143                              RelExpr Expr) const {
144   switch (Expr) {
145   default:
146     return Expr;
147   case R_RELAX_TLS_GD_TO_IE:
148     return R_RELAX_TLS_GD_TO_IE_END;
149   case R_RELAX_TLS_GD_TO_LE:
150     return R_RELAX_TLS_GD_TO_LE_NEG;
151   }
152 }
153
154 void X86::writeGotPltHeader(uint8_t *Buf) const {
155   write32le(Buf, InX::Dynamic->getVA());
156 }
157
158 void X86::writeGotPlt(uint8_t *Buf, const Symbol &S) const {
159   // Entries in .got.plt initially points back to the corresponding
160   // PLT entries with a fixed offset to skip the first instruction.
161   write32le(Buf, S.getPltVA() + 6);
162 }
163
164 void X86::writeIgotPlt(uint8_t *Buf, const Symbol &S) const {
165   // An x86 entry is the address of the ifunc resolver function.
166   write32le(Buf, S.getVA());
167 }
168
169 RelType X86::getDynRel(RelType Type) const {
170   if (Type == R_386_TLS_LE)
171     return R_386_TLS_TPOFF;
172   if (Type == R_386_TLS_LE_32)
173     return R_386_TLS_TPOFF32;
174   return Type;
175 }
176
177 void X86::writePltHeader(uint8_t *Buf) const {
178   if (Config->Pic) {
179     const uint8_t V[] = {
180         0xff, 0xb3, 0x04, 0x00, 0x00, 0x00, // pushl GOTPLT+4(%ebx)
181         0xff, 0xa3, 0x08, 0x00, 0x00, 0x00, // jmp *GOTPLT+8(%ebx)
182         0x90, 0x90, 0x90, 0x90              // nop
183     };
184     memcpy(Buf, V, sizeof(V));
185
186     uint32_t Ebx = InX::Got->getVA() + InX::Got->getSize();
187     uint32_t GotPlt = InX::GotPlt->getVA() - Ebx;
188     write32le(Buf + 2, GotPlt + 4);
189     write32le(Buf + 8, GotPlt + 8);
190     return;
191   }
192
193   const uint8_t PltData[] = {
194       0xff, 0x35, 0, 0, 0, 0, // pushl (GOTPLT+4)
195       0xff, 0x25, 0, 0, 0, 0, // jmp *(GOTPLT+8)
196       0x90, 0x90, 0x90, 0x90, // nop
197   };
198   memcpy(Buf, PltData, sizeof(PltData));
199   uint32_t GotPlt = InX::GotPlt->getVA();
200   write32le(Buf + 2, GotPlt + 4);
201   write32le(Buf + 8, GotPlt + 8);
202 }
203
204 void X86::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr,
205                    uint64_t PltEntryAddr, int32_t Index,
206                    unsigned RelOff) const {
207   const uint8_t Inst[] = {
208       0xff, 0x00, 0, 0, 0, 0, // jmp *foo_in_GOT or jmp *foo@GOT(%ebx)
209       0x68, 0, 0, 0, 0,       // pushl $reloc_offset
210       0xe9, 0, 0, 0, 0,       // jmp .PLT0@PC
211   };
212   memcpy(Buf, Inst, sizeof(Inst));
213
214   if (Config->Pic) {
215     // jmp *foo@GOT(%ebx)
216     uint32_t Ebx = InX::Got->getVA() + InX::Got->getSize();
217     Buf[1] = 0xa3;
218     write32le(Buf + 2, GotPltEntryAddr - Ebx);
219   } else {
220     // jmp *foo_in_GOT
221     Buf[1] = 0x25;
222     write32le(Buf + 2, GotPltEntryAddr);
223   }
224
225   write32le(Buf + 7, RelOff);
226   write32le(Buf + 12, -getPltEntryOffset(Index) - 16);
227 }
228
229 int64_t X86::getImplicitAddend(const uint8_t *Buf, RelType Type) const {
230   switch (Type) {
231   case R_386_8:
232   case R_386_PC8:
233     return SignExtend64<8>(*Buf);
234   case R_386_16:
235   case R_386_PC16:
236     return SignExtend64<16>(read16le(Buf));
237   case R_386_32:
238   case R_386_GOT32:
239   case R_386_GOT32X:
240   case R_386_GOTOFF:
241   case R_386_GOTPC:
242   case R_386_PC32:
243   case R_386_PLT32:
244   case R_386_TLS_LDO_32:
245   case R_386_TLS_LE:
246     return SignExtend64<32>(read32le(Buf));
247   default:
248     return 0;
249   }
250 }
251
252 void X86::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
253   switch (Type) {
254   case R_386_8:
255     // R_386_{PC,}{8,16} are not part of the i386 psABI, but they are
256     // being used for some 16-bit programs such as boot loaders, so
257     // we want to support them.
258     checkIntUInt(Loc, Val, 8, Type);
259     *Loc = Val;
260     break;
261   case R_386_PC8:
262     checkInt(Loc, Val, 8, Type);
263     *Loc = Val;
264     break;
265   case R_386_16:
266     checkIntUInt(Loc, Val, 16, Type);
267     write16le(Loc, Val);
268     break;
269   case R_386_PC16:
270     // R_386_PC16 is normally used with 16 bit code. In that situation
271     // the PC is 16 bits, just like the addend. This means that it can
272     // point from any 16 bit address to any other if the possibility
273     // of wrapping is included.
274     // The only restriction we have to check then is that the destination
275     // address fits in 16 bits. That is impossible to do here. The problem is
276     // that we are passed the final value, which already had the
277     // current location subtracted from it.
278     // We just check that Val fits in 17 bits. This misses some cases, but
279     // should have no false positives.
280     checkInt(Loc, Val, 17, Type);
281     write16le(Loc, Val);
282     break;
283   case R_386_32:
284   case R_386_GLOB_DAT:
285   case R_386_GOT32:
286   case R_386_GOT32X:
287   case R_386_GOTOFF:
288   case R_386_GOTPC:
289   case R_386_PC32:
290   case R_386_PLT32:
291   case R_386_RELATIVE:
292   case R_386_TLS_DTPMOD32:
293   case R_386_TLS_DTPOFF32:
294   case R_386_TLS_GD:
295   case R_386_TLS_GOTIE:
296   case R_386_TLS_IE:
297   case R_386_TLS_LDM:
298   case R_386_TLS_LDO_32:
299   case R_386_TLS_LE:
300   case R_386_TLS_LE_32:
301   case R_386_TLS_TPOFF:
302   case R_386_TLS_TPOFF32:
303     checkInt(Loc, Val, 32, Type);
304     write32le(Loc, Val);
305     break;
306   default:
307     error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type));
308   }
309 }
310
311 void X86::relaxTlsGdToLe(uint8_t *Loc, RelType Type, uint64_t Val) const {
312   // Convert
313   //   leal x@tlsgd(, %ebx, 1),
314   //   call __tls_get_addr@plt
315   // to
316   //   movl %gs:0,%eax
317   //   subl $x@ntpoff,%eax
318   const uint8_t Inst[] = {
319       0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0, %eax
320       0x81, 0xe8, 0, 0, 0, 0,             // subl Val(%ebx), %eax
321   };
322   memcpy(Loc - 3, Inst, sizeof(Inst));
323   write32le(Loc + 5, Val);
324 }
325
326 void X86::relaxTlsGdToIe(uint8_t *Loc, RelType Type, uint64_t Val) const {
327   // Convert
328   //   leal x@tlsgd(, %ebx, 1),
329   //   call __tls_get_addr@plt
330   // to
331   //   movl %gs:0, %eax
332   //   addl x@gotntpoff(%ebx), %eax
333   const uint8_t Inst[] = {
334       0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0, %eax
335       0x03, 0x83, 0, 0, 0, 0,             // addl Val(%ebx), %eax
336   };
337   memcpy(Loc - 3, Inst, sizeof(Inst));
338   write32le(Loc + 5, Val);
339 }
340
341 // In some conditions, relocations can be optimized to avoid using GOT.
342 // This function does that for Initial Exec to Local Exec case.
343 void X86::relaxTlsIeToLe(uint8_t *Loc, RelType Type, uint64_t Val) const {
344   // Ulrich's document section 6.2 says that @gotntpoff can
345   // be used with MOVL or ADDL instructions.
346   // @indntpoff is similar to @gotntpoff, but for use in
347   // position dependent code.
348   uint8_t Reg = (Loc[-1] >> 3) & 7;
349
350   if (Type == R_386_TLS_IE) {
351     if (Loc[-1] == 0xa1) {
352       // "movl foo@indntpoff,%eax" -> "movl $foo,%eax"
353       // This case is different from the generic case below because
354       // this is a 5 byte instruction while below is 6 bytes.
355       Loc[-1] = 0xb8;
356     } else if (Loc[-2] == 0x8b) {
357       // "movl foo@indntpoff,%reg" -> "movl $foo,%reg"
358       Loc[-2] = 0xc7;
359       Loc[-1] = 0xc0 | Reg;
360     } else {
361       // "addl foo@indntpoff,%reg" -> "addl $foo,%reg"
362       Loc[-2] = 0x81;
363       Loc[-1] = 0xc0 | Reg;
364     }
365   } else {
366     assert(Type == R_386_TLS_GOTIE);
367     if (Loc[-2] == 0x8b) {
368       // "movl foo@gottpoff(%rip),%reg" -> "movl $foo,%reg"
369       Loc[-2] = 0xc7;
370       Loc[-1] = 0xc0 | Reg;
371     } else {
372       // "addl foo@gotntpoff(%rip),%reg" -> "leal foo(%reg),%reg"
373       Loc[-2] = 0x8d;
374       Loc[-1] = 0x80 | (Reg << 3) | Reg;
375     }
376   }
377   write32le(Loc, Val);
378 }
379
380 void X86::relaxTlsLdToLe(uint8_t *Loc, RelType Type, uint64_t Val) const {
381   if (Type == R_386_TLS_LDO_32) {
382     write32le(Loc, Val);
383     return;
384   }
385
386   // Convert
387   //   leal foo(%reg),%eax
388   //   call ___tls_get_addr
389   // to
390   //   movl %gs:0,%eax
391   //   nop
392   //   leal 0(%esi,1),%esi
393   const uint8_t Inst[] = {
394       0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, // movl %gs:0,%eax
395       0x90,                               // nop
396       0x8d, 0x74, 0x26, 0x00,             // leal 0(%esi,1),%esi
397   };
398   memcpy(Loc - 2, Inst, sizeof(Inst));
399 }
400
401 namespace {
402 class RetpolinePic : public X86 {
403 public:
404   RetpolinePic();
405   void writeGotPlt(uint8_t *Buf, const Symbol &S) const override;
406   void writePltHeader(uint8_t *Buf) const override;
407   void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr,
408                 int32_t Index, unsigned RelOff) const override;
409 };
410
411 class RetpolineNoPic : public X86 {
412 public:
413   RetpolineNoPic();
414   void writeGotPlt(uint8_t *Buf, const Symbol &S) const override;
415   void writePltHeader(uint8_t *Buf) const override;
416   void writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr, uint64_t PltEntryAddr,
417                 int32_t Index, unsigned RelOff) const override;
418 };
419 } // namespace
420
421 RetpolinePic::RetpolinePic() {
422   PltHeaderSize = 48;
423   PltEntrySize = 32;
424 }
425
426 void RetpolinePic::writeGotPlt(uint8_t *Buf, const Symbol &S) const {
427   write32le(Buf, S.getPltVA() + 17);
428 }
429
430 void RetpolinePic::writePltHeader(uint8_t *Buf) const {
431   const uint8_t Insn[] = {
432       0xff, 0xb3, 0,    0,    0,    0,          // 0:    pushl GOTPLT+4(%ebx)
433       0x50,                                     // 6:    pushl %eax
434       0x8b, 0x83, 0,    0,    0,    0,          // 7:    mov GOTPLT+8(%ebx), %eax
435       0xe8, 0x0e, 0x00, 0x00, 0x00,             // d:    call next
436       0xf3, 0x90,                               // 12: loop: pause
437       0x0f, 0xae, 0xe8,                         // 14:   lfence
438       0xeb, 0xf9,                               // 17:   jmp loop
439       0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, // 19:   int3; .align 16
440       0x89, 0x0c, 0x24,                         // 20: next: mov %ecx, (%esp)
441       0x8b, 0x4c, 0x24, 0x04,                   // 23:   mov 0x4(%esp), %ecx
442       0x89, 0x44, 0x24, 0x04,                   // 27:   mov %eax ,0x4(%esp)
443       0x89, 0xc8,                               // 2b:   mov %ecx, %eax
444       0x59,                                     // 2d:   pop %ecx
445       0xc3,                                     // 2e:   ret
446       0xcc,                                     // 2f:   int3; padding
447   };
448   memcpy(Buf, Insn, sizeof(Insn));
449
450   uint32_t Ebx = InX::Got->getVA() + InX::Got->getSize();
451   uint32_t GotPlt = InX::GotPlt->getVA() - Ebx;
452   write32le(Buf + 2, GotPlt + 4);
453   write32le(Buf + 9, GotPlt + 8);
454 }
455
456 void RetpolinePic::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr,
457                             uint64_t PltEntryAddr, int32_t Index,
458                             unsigned RelOff) const {
459   const uint8_t Insn[] = {
460       0x50,                            // pushl %eax
461       0x8b, 0x83, 0,    0,    0,    0, // mov foo@GOT(%ebx), %eax
462       0xe8, 0,    0,    0,    0,       // call plt+0x20
463       0xe9, 0,    0,    0,    0,       // jmp plt+0x12
464       0x68, 0,    0,    0,    0,       // pushl $reloc_offset
465       0xe9, 0,    0,    0,    0,       // jmp plt+0
466       0xcc, 0xcc, 0xcc, 0xcc, 0xcc,    // int3; padding
467   };
468   memcpy(Buf, Insn, sizeof(Insn));
469
470   uint32_t Ebx = InX::Got->getVA() + InX::Got->getSize();
471   unsigned Off = getPltEntryOffset(Index);
472   write32le(Buf + 3, GotPltEntryAddr - Ebx);
473   write32le(Buf + 8, -Off - 12 + 32);
474   write32le(Buf + 13, -Off - 17 + 18);
475   write32le(Buf + 18, RelOff);
476   write32le(Buf + 23, -Off - 27);
477 }
478
479 RetpolineNoPic::RetpolineNoPic() {
480   PltHeaderSize = 48;
481   PltEntrySize = 32;
482 }
483
484 void RetpolineNoPic::writeGotPlt(uint8_t *Buf, const Symbol &S) const {
485   write32le(Buf, S.getPltVA() + 16);
486 }
487
488 void RetpolineNoPic::writePltHeader(uint8_t *Buf) const {
489   const uint8_t Insn[] = {
490       0xff, 0x35, 0,    0,    0,    0, // 0:    pushl GOTPLT+4
491       0x50,                            // 6:    pushl %eax
492       0xa1, 0,    0,    0,    0,       // 7:    mov GOTPLT+8, %eax
493       0xe8, 0x0f, 0x00, 0x00, 0x00,    // c:    call next
494       0xf3, 0x90,                      // 11: loop: pause
495       0x0f, 0xae, 0xe8,                // 13:   lfence
496       0xeb, 0xf9,                      // 16:   jmp loop
497       0xcc, 0xcc, 0xcc, 0xcc, 0xcc,    // 18:   int3
498       0xcc, 0xcc, 0xcc,                // 1f:   int3; .align 16
499       0x89, 0x0c, 0x24,                // 20: next: mov %ecx, (%esp)
500       0x8b, 0x4c, 0x24, 0x04,          // 23:   mov 0x4(%esp), %ecx
501       0x89, 0x44, 0x24, 0x04,          // 27:   mov %eax ,0x4(%esp)
502       0x89, 0xc8,                      // 2b:   mov %ecx, %eax
503       0x59,                            // 2d:   pop %ecx
504       0xc3,                            // 2e:   ret
505       0xcc,                            // 2f:   int3; padding
506   };
507   memcpy(Buf, Insn, sizeof(Insn));
508
509   uint32_t GotPlt = InX::GotPlt->getVA();
510   write32le(Buf + 2, GotPlt + 4);
511   write32le(Buf + 8, GotPlt + 8);
512 }
513
514 void RetpolineNoPic::writePlt(uint8_t *Buf, uint64_t GotPltEntryAddr,
515                               uint64_t PltEntryAddr, int32_t Index,
516                               unsigned RelOff) const {
517   const uint8_t Insn[] = {
518       0x50,                         // 0:  pushl %eax
519       0xa1, 0,    0,    0,    0,    // 1:  mov foo_in_GOT, %eax
520       0xe8, 0,    0,    0,    0,    // 6:  call plt+0x20
521       0xe9, 0,    0,    0,    0,    // b:  jmp plt+0x11
522       0x68, 0,    0,    0,    0,    // 10: pushl $reloc_offset
523       0xe9, 0,    0,    0,    0,    // 15: jmp plt+0
524       0xcc, 0xcc, 0xcc, 0xcc, 0xcc, // 1a: int3; padding
525       0xcc,                         // 1f: int3; padding
526   };
527   memcpy(Buf, Insn, sizeof(Insn));
528
529   unsigned Off = getPltEntryOffset(Index);
530   write32le(Buf + 2, GotPltEntryAddr);
531   write32le(Buf + 7, -Off - 11 + 32);
532   write32le(Buf + 12, -Off - 16 + 17);
533   write32le(Buf + 17, RelOff);
534   write32le(Buf + 22, -Off - 26);
535 }
536
537 TargetInfo *elf::getX86TargetInfo() {
538   if (Config->ZRetpolineplt) {
539     if (Config->Pic) {
540       static RetpolinePic T;
541       return &T;
542     }
543     static RetpolineNoPic T;
544     return &T;
545   }
546
547   static X86 T;
548   return &T;
549 }