LLVM 23.0.0git
MipsELFObjectWriter.cpp
Go to the documentation of this file.
1//===-- MipsELFObjectWriter.cpp - Mips ELF Writer -------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
12#include "llvm/ADT/STLExtras.h"
14#include "llvm/MC/MCContext.h"
16#include "llvm/MC/MCFixup.h"
18#include "llvm/MC/MCSymbolELF.h"
19#include "llvm/MC/MCValue.h"
21#include "llvm/Support/Debug.h"
25#include <cassert>
26#include <cstdint>
27#include <iterator>
28#include <list>
29#include <utility>
30
31#define DEBUG_TYPE "mips-elf-object-writer"
32
33using namespace llvm;
34
35namespace {
36
37/// Holds additional information needed by the relocation ordering algorithm.
38struct MipsRelocationEntry {
39 const ELFRelocationEntry R; ///< The relocation.
40 bool Matched = false; ///< Is this relocation part of a match.
41
42 MipsRelocationEntry(const ELFRelocationEntry &R) : R(R) {}
43};
44
45class MipsELFObjectWriter : public MCELFObjectTargetWriter {
46public:
47 MipsELFObjectWriter(uint8_t OSABI, bool HasRelocationAddend, bool Is64);
48
49 ~MipsELFObjectWriter() override = default;
50
51 unsigned getRelocType(const MCFixup &, const MCValue &,
52 bool IsPCRel) const override;
53 bool needsRelocateWithSymbol(const MCValue &, unsigned Type) const override;
54 void sortRelocs(std::vector<ELFRelocationEntry> &Relocs) override;
55};
56
57} // end anonymous namespace
58
59/// Determine the low relocation that matches the given relocation.
60/// If the relocation does not need a low relocation then the return value
61/// is ELF::R_MIPS_NONE.
62///
63/// The relocations that need a matching low part are
64/// R_(MIPS|MICROMIPS|MIPS16)_HI16 for all symbols and
65/// R_(MIPS|MICROMIPS|MIPS16)_GOT16 for local symbols only.
67 unsigned Type = Reloc.Type;
68 if (Type == ELF::R_MIPS_HI16)
69 return ELF::R_MIPS_LO16;
70 if (Type == ELF::R_MICROMIPS_HI16)
71 return ELF::R_MICROMIPS_LO16;
72 if (Type == ELF::R_MIPS16_HI16)
73 return ELF::R_MIPS16_LO16;
74
75 if (Reloc.Symbol && Reloc.Symbol->getBinding() != ELF::STB_LOCAL)
76 return ELF::R_MIPS_NONE;
77
78 if (Type == ELF::R_MIPS_GOT16)
79 return ELF::R_MIPS_LO16;
80 if (Type == ELF::R_MICROMIPS_GOT16)
81 return ELF::R_MICROMIPS_LO16;
82 if (Type == ELF::R_MIPS16_GOT16)
83 return ELF::R_MIPS16_LO16;
84
85 return ELF::R_MIPS_NONE;
86}
87
88// Determine whether a relocation X is a low-part and matches the high-part R
89// perfectly by symbol and addend.
90static bool isMatchingReloc(unsigned MatchingType, const ELFRelocationEntry &R,
91 const ELFRelocationEntry &X) {
92 return X.Type == MatchingType && X.Symbol == R.Symbol && X.Addend == R.Addend;
93}
94
95MipsELFObjectWriter::MipsELFObjectWriter(uint8_t OSABI,
96 bool HasRelocationAddend, bool Is64)
97 : MCELFObjectTargetWriter(Is64, OSABI, ELF::EM_MIPS, HasRelocationAddend) {}
98
99unsigned MipsELFObjectWriter::getRelocType(const MCFixup &Fixup,
100 const MCValue &Target,
101 bool IsPCRel) const {
102 // Determine the type of the relocation.
103 auto Kind = Fixup.getKind();
104 switch (Target.getSpecifier()) {
105 case Mips::S_DTPREL:
108 case Mips::S_TLSLDM:
109 case Mips::S_TLSGD:
110 case Mips::S_GOTTPREL:
111 case Mips::S_TPREL_HI:
112 case Mips::S_TPREL_LO:
113 if (auto *SA = const_cast<MCSymbol *>(Target.getAddSym()))
114 static_cast<MCSymbolELF *>(SA)->setType(ELF::STT_TLS);
115 break;
116 default:
117 break;
118 }
119
120 switch (Kind) {
121 case FK_NONE:
122 return ELF::R_MIPS_NONE;
123 case FK_Data_1:
124 reportError(Fixup.getLoc(), "MIPS does not support one byte relocations");
125 return ELF::R_MIPS_NONE;
127 case FK_Data_2:
128 return IsPCRel ? ELF::R_MIPS_PC16 : ELF::R_MIPS_16;
130 case FK_Data_4:
131 return IsPCRel ? ELF::R_MIPS_PC32 : ELF::R_MIPS_32;
133 case FK_Data_8:
134 return IsPCRel
135 ? setRTypes(ELF::R_MIPS_PC32, ELF::R_MIPS_64, ELF::R_MIPS_NONE)
136 : (unsigned)ELF::R_MIPS_64;
137 }
138
139 if (IsPCRel) {
140 switch (Kind) {
143 return ELF::R_MIPS_PC16;
145 return ELF::R_MICROMIPS_PC7_S1;
147 return ELF::R_MICROMIPS_PC10_S1;
149 return ELF::R_MICROMIPS_PC16_S1;
151 return ELF::R_MICROMIPS_PC26_S1;
153 return ELF::R_MICROMIPS_PC19_S2;
155 return ELF::R_MICROMIPS_PC18_S3;
157 return ELF::R_MICROMIPS_PC21_S1;
159 return ELF::R_MIPS_PC19_S2;
161 return ELF::R_MIPS_PC18_S3;
163 return ELF::R_MIPS_PC21_S2;
165 return ELF::R_MIPS_PC26_S2;
167 return ELF::R_MIPS_PCHI16;
169 return ELF::R_MIPS_PCLO16;
170 }
171
172 llvm_unreachable("invalid PC-relative fixup kind!");
173 }
174
175 switch (Kind) {
177 return ELF::R_MIPS_TLS_DTPREL32;
179 return ELF::R_MIPS_TLS_DTPREL64;
181 return ELF::R_MIPS_TLS_TPREL32;
183 return ELF::R_MIPS_TLS_TPREL64;
185 return setRTypes(ELF::R_MIPS_GPREL32,
186 is64Bit() ? ELF::R_MIPS_64 : ELF::R_MIPS_NONE,
187 ELF::R_MIPS_NONE);
189 return ELF::R_MIPS_GPREL16;
191 return ELF::R_MIPS_26;
193 return ELF::R_MIPS_CALL16;
195 return ELF::R_MIPS_GOT16;
197 return ELF::R_MIPS_HI16;
199 return ELF::R_MIPS_LO16;
201 return ELF::R_MIPS_TLS_GD;
203 return ELF::R_MIPS_TLS_GOTTPREL;
205 return ELF::R_MIPS_TLS_TPREL_HI16;
207 return ELF::R_MIPS_TLS_TPREL_LO16;
209 return ELF::R_MIPS_TLS_LDM;
211 return ELF::R_MIPS_TLS_DTPREL_HI16;
213 return ELF::R_MIPS_TLS_DTPREL_LO16;
215 return ELF::R_MIPS_GOT_PAGE;
217 return ELF::R_MIPS_GOT_OFST;
219 return ELF::R_MIPS_GOT_DISP;
221 return setRTypes(ELF::R_MIPS_GPREL16, ELF::R_MIPS_SUB, ELF::R_MIPS_HI16);
223 return setRTypes(ELF::R_MICROMIPS_GPREL16, ELF::R_MICROMIPS_SUB,
224 ELF::R_MICROMIPS_HI16);
226 return setRTypes(ELF::R_MIPS_GPREL16, ELF::R_MIPS_SUB, ELF::R_MIPS_LO16);
228 return setRTypes(ELF::R_MICROMIPS_GPREL16, ELF::R_MICROMIPS_SUB,
229 ELF::R_MICROMIPS_LO16);
231 return ELF::R_MIPS_HIGHER;
233 return ELF::R_MIPS_HIGHEST;
235 return ELF::R_MIPS_SUB;
237 return ELF::R_MIPS_GOT_HI16;
239 return ELF::R_MIPS_GOT_LO16;
241 return ELF::R_MIPS_CALL_HI16;
243 return ELF::R_MIPS_CALL_LO16;
245 return ELF::R_MICROMIPS_26_S1;
247 return ELF::R_MICROMIPS_HI16;
249 return ELF::R_MICROMIPS_LO16;
251 return ELF::R_MICROMIPS_GOT16;
253 return ELF::R_MICROMIPS_CALL16;
255 return ELF::R_MICROMIPS_GOT_DISP;
257 return ELF::R_MICROMIPS_GOT_PAGE;
259 return ELF::R_MICROMIPS_GOT_OFST;
261 return ELF::R_MICROMIPS_TLS_GD;
263 return ELF::R_MICROMIPS_TLS_LDM;
265 return ELF::R_MICROMIPS_TLS_DTPREL_HI16;
267 return ELF::R_MICROMIPS_TLS_DTPREL_LO16;
269 return ELF::R_MICROMIPS_TLS_GOTTPREL;
271 return ELF::R_MICROMIPS_TLS_TPREL_HI16;
273 return ELF::R_MICROMIPS_TLS_TPREL_LO16;
275 return ELF::R_MICROMIPS_SUB;
277 return ELF::R_MICROMIPS_HIGHER;
279 return ELF::R_MICROMIPS_HIGHEST;
281 return ELF::R_MIPS_JALR;
283 return ELF::R_MICROMIPS_JALR;
284 }
285
286 reportError(Fixup.getLoc(), "unsupported relocation type");
287 return ELF::R_MIPS_NONE;
288}
289
290/// Sort relocation table entries by offset except where another order is
291/// required by the MIPS ABI.
292///
293/// MIPS has a few relocations that have an AHL component in the expression used
294/// to evaluate them. This AHL component is an addend with the same number of
295/// bits as a symbol value but not all of our ABI's are able to supply a
296/// sufficiently sized addend in a single relocation.
297///
298/// The O32 ABI for example, uses REL relocations which store the addend in the
299/// section data. All the relocations with AHL components affect 16-bit fields
300/// so the addend for a single relocation is limited to 16-bit. This ABI
301/// resolves the limitation by linking relocations (e.g. R_MIPS_HI16 and
302/// R_MIPS_LO16) and distributing the addend between the linked relocations. The
303/// ABI mandates that such relocations must be next to each other in a
304/// particular order (e.g. R_MIPS_HI16 must be immediately followed by a
305/// matching R_MIPS_LO16) but the rule is less strict in practice.
306///
307/// The de facto standard is lenient in the following ways:
308/// - 'Immediately following' does not refer to the next relocation entry but
309/// the next matching relocation.
310/// - There may be multiple high parts relocations for one low part relocation.
311/// - There may be multiple low part relocations for one high part relocation.
312/// - The AHL addend in each part does not have to be exactly equal as long as
313/// the difference does not affect the carry bit from bit 15 into 16. This is
314/// to allow, for example, the use of %lo(foo) and %lo(foo+4) when loading
315/// both halves of a long long.
316///
317/// See getMatchingLoType() for a description of which high part relocations
318/// match which low part relocations. One particular thing to note is that
319/// R_MIPS_GOT16 and similar only have AHL addends if they refer to local
320/// symbols.
321///
322/// It should also be noted that this function is not affected by whether
323/// the symbol was kept or rewritten into a section-relative equivalent. We
324/// always match using the expressions from the source.
325void MipsELFObjectWriter::sortRelocs(std::vector<ELFRelocationEntry> &Relocs) {
326 // We do not need to sort the relocation table for RELA relocations which
327 // N32/N64 uses as the relocation addend contains the value we require,
328 // rather than it being split across a pair of relocations.
329 if (hasRelocationAddend())
330 return;
331
332 // Sort relocations by r_offset. There might be more than one at an offset
333 // with composed relocations or .reloc directives.
335 Relocs, [](const ELFRelocationEntry &A, const ELFRelocationEntry &B) {
336 return A.Offset < B.Offset;
337 });
338
339 // Place relocations in a list for reorder convenience. Hi16 contains the
340 // iterators of high-part relocations.
341 std::list<MipsRelocationEntry> Sorted;
342 SmallVector<std::list<MipsRelocationEntry>::iterator, 0> Hi16;
343 for (auto &R : Relocs) {
344 Sorted.push_back(R);
345 if (getMatchingLoType(R) != ELF::R_MIPS_NONE)
346 Hi16.push_back(std::prev(Sorted.end()));
347 }
348
349 for (auto I : Hi16) {
350 auto &R = I->R;
351 unsigned MatchingType = getMatchingLoType(R);
352 // If the next relocation is a perfect match, continue;
353 if (std::next(I) != Sorted.end() &&
354 isMatchingReloc(MatchingType, R, std::next(I)->R))
355 continue;
356 // Otherwise, find the best matching low-part relocation with the following
357 // criteria. It must have the same symbol and its addend is no lower than
358 // that of the current high-part.
359 //
360 // (1) %lo with a smaller offset is preferred.
361 // (2) %lo with the same offset that is unmatched is preferred.
362 // (3) later %lo is preferred.
363 auto Best = Sorted.end();
364 for (auto J = Sorted.begin(); J != Sorted.end(); ++J) {
365 auto &R1 = J->R;
366 if (R1.Type == MatchingType && R.Symbol == R1.Symbol &&
367 R.Addend <= R1.Addend &&
368 (Best == Sorted.end() || R1.Addend < Best->R.Addend ||
369 (!Best->Matched && R1.Addend == Best->R.Addend)))
370 Best = J;
371 }
372 if (Best != Sorted.end() && R.Addend == Best->R.Addend)
373 Best->Matched = true;
374
375 // Move the high-part before the low-part, or if not found, the end of the
376 // list. The unmatched high-part will lead to a linker warning/error.
377 Sorted.splice(Best, Sorted, I);
378 }
379
380 assert(Relocs.size() == Sorted.size() && "Some relocs were not consumed");
381
382 // Overwrite the original vector with the sorted elements.
383 unsigned CopyTo = 0;
384 for (const auto &R : Sorted)
385 Relocs[CopyTo++] = R.R;
386}
387
388bool MipsELFObjectWriter::needsRelocateWithSymbol(const MCValue &V,
389 unsigned Type) const {
390 // If it's a compound relocation for N64 then we need the relocation if any
391 // sub-relocation needs it.
392 if (!isUInt<8>(Type))
393 return needsRelocateWithSymbol(V, Type & 0xff) ||
394 needsRelocateWithSymbol(V, (Type >> 8) & 0xff) ||
395 needsRelocateWithSymbol(V, (Type >> 16) & 0xff);
396
397 auto *Sym = static_cast<const MCSymbolELF *>(V.getAddSym());
398 switch (Type) {
399 default:
400 errs() << Type << "\n";
401 llvm_unreachable("Unexpected relocation");
402 return true;
403
404 // This relocation doesn't affect the section data.
405 case ELF::R_MIPS_NONE:
406 return false;
407
408 // On REL ABI's (e.g. O32), these relocations form pairs. The pairing is done
409 // by the static linker by matching the symbol and offset.
410 // We only see one relocation at a time but it's still safe to relocate with
411 // the section so long as both relocations make the same decision.
412 //
413 // Some older linkers may require the symbol for particular cases. Such cases
414 // are not supported yet but can be added as required.
415 case ELF::R_MIPS_GOT16:
416 case ELF::R_MIPS16_GOT16:
417 case ELF::R_MICROMIPS_GOT16:
418 case ELF::R_MIPS_HIGHER:
419 case ELF::R_MIPS_HIGHEST:
420 case ELF::R_MIPS_HI16:
421 case ELF::R_MIPS16_HI16:
422 case ELF::R_MICROMIPS_HI16:
423 case ELF::R_MIPS_LO16:
424 case ELF::R_MIPS16_LO16:
425 case ELF::R_MICROMIPS_LO16:
426 // FIXME: It should be safe to return false for the STO_MIPS_MICROMIPS but
427 // we neglect to handle the adjustment to the LSB of the addend that
428 // it causes in applyFixup() and similar.
429 if (Sym->getOther() & ELF::STO_MIPS_MICROMIPS)
430 return true;
431 return false;
432
433 case ELF::R_MIPS_GOT_PAGE:
434 case ELF::R_MICROMIPS_GOT_PAGE:
435 case ELF::R_MIPS_GOT_OFST:
436 case ELF::R_MICROMIPS_GOT_OFST:
437 case ELF::R_MIPS_16:
438 case ELF::R_MIPS_32:
439 case ELF::R_MIPS_GPREL32:
440 if (Sym->getOther() & ELF::STO_MIPS_MICROMIPS)
441 return true;
442 [[fallthrough]];
443 case ELF::R_MIPS_26:
444 case ELF::R_MIPS_64:
445 case ELF::R_MIPS_GPREL16:
446 case ELF::R_MIPS_PC16:
447 case ELF::R_MIPS_SUB:
448 return false;
449
450 // FIXME: Many of these relocations should probably return false but this
451 // hasn't been confirmed to be safe yet.
452 case ELF::R_MIPS_REL32:
453 case ELF::R_MIPS_LITERAL:
454 case ELF::R_MIPS_CALL16:
455 case ELF::R_MIPS_SHIFT5:
456 case ELF::R_MIPS_SHIFT6:
457 case ELF::R_MIPS_GOT_DISP:
458 case ELF::R_MIPS_GOT_HI16:
459 case ELF::R_MIPS_GOT_LO16:
460 case ELF::R_MIPS_INSERT_A:
461 case ELF::R_MIPS_INSERT_B:
462 case ELF::R_MIPS_DELETE:
463 case ELF::R_MIPS_CALL_HI16:
464 case ELF::R_MIPS_CALL_LO16:
465 case ELF::R_MIPS_SCN_DISP:
466 case ELF::R_MIPS_REL16:
467 case ELF::R_MIPS_ADD_IMMEDIATE:
468 case ELF::R_MIPS_PJUMP:
469 case ELF::R_MIPS_RELGOT:
470 case ELF::R_MIPS_JALR:
471 case ELF::R_MIPS_TLS_DTPMOD32:
472 case ELF::R_MIPS_TLS_DTPREL32:
473 case ELF::R_MIPS_TLS_DTPMOD64:
474 case ELF::R_MIPS_TLS_DTPREL64:
475 case ELF::R_MIPS_TLS_GD:
476 case ELF::R_MIPS_TLS_LDM:
477 case ELF::R_MIPS_TLS_DTPREL_HI16:
478 case ELF::R_MIPS_TLS_DTPREL_LO16:
479 case ELF::R_MIPS_TLS_GOTTPREL:
480 case ELF::R_MIPS_TLS_TPREL32:
481 case ELF::R_MIPS_TLS_TPREL64:
482 case ELF::R_MIPS_TLS_TPREL_HI16:
483 case ELF::R_MIPS_TLS_TPREL_LO16:
484 case ELF::R_MIPS_GLOB_DAT:
485 case ELF::R_MIPS_PC21_S2:
486 case ELF::R_MIPS_PC26_S2:
487 case ELF::R_MIPS_PC18_S3:
488 case ELF::R_MIPS_PC19_S2:
489 case ELF::R_MIPS_PCHI16:
490 case ELF::R_MIPS_PCLO16:
491 case ELF::R_MIPS_COPY:
492 case ELF::R_MIPS_JUMP_SLOT:
493 case ELF::R_MIPS_NUM:
494 case ELF::R_MIPS_PC32:
495 case ELF::R_MIPS_EH:
496 case ELF::R_MICROMIPS_26_S1:
497 case ELF::R_MICROMIPS_GPREL16:
498 case ELF::R_MICROMIPS_LITERAL:
499 case ELF::R_MICROMIPS_PC7_S1:
500 case ELF::R_MICROMIPS_PC10_S1:
501 case ELF::R_MICROMIPS_PC16_S1:
502 case ELF::R_MICROMIPS_CALL16:
503 case ELF::R_MICROMIPS_GOT_DISP:
504 case ELF::R_MICROMIPS_GOT_HI16:
505 case ELF::R_MICROMIPS_GOT_LO16:
506 case ELF::R_MICROMIPS_SUB:
507 case ELF::R_MICROMIPS_HIGHER:
508 case ELF::R_MICROMIPS_HIGHEST:
509 case ELF::R_MICROMIPS_CALL_HI16:
510 case ELF::R_MICROMIPS_CALL_LO16:
511 case ELF::R_MICROMIPS_SCN_DISP:
512 case ELF::R_MICROMIPS_JALR:
513 case ELF::R_MICROMIPS_HI0_LO16:
514 case ELF::R_MICROMIPS_TLS_GD:
515 case ELF::R_MICROMIPS_TLS_LDM:
516 case ELF::R_MICROMIPS_TLS_DTPREL_HI16:
517 case ELF::R_MICROMIPS_TLS_DTPREL_LO16:
518 case ELF::R_MICROMIPS_TLS_GOTTPREL:
519 case ELF::R_MICROMIPS_TLS_TPREL_HI16:
520 case ELF::R_MICROMIPS_TLS_TPREL_LO16:
521 case ELF::R_MICROMIPS_GPREL7_S2:
522 case ELF::R_MICROMIPS_PC23_S2:
523 case ELF::R_MICROMIPS_PC21_S1:
524 case ELF::R_MICROMIPS_PC26_S1:
525 case ELF::R_MICROMIPS_PC18_S3:
526 case ELF::R_MICROMIPS_PC19_S2:
527 return true;
528
529 // FIXME: Many of these should probably return false but MIPS16 isn't
530 // supported by the integrated assembler.
531 case ELF::R_MIPS16_26:
532 case ELF::R_MIPS16_GPREL:
533 case ELF::R_MIPS16_CALL16:
534 case ELF::R_MIPS16_TLS_GD:
535 case ELF::R_MIPS16_TLS_LDM:
536 case ELF::R_MIPS16_TLS_DTPREL_HI16:
537 case ELF::R_MIPS16_TLS_DTPREL_LO16:
538 case ELF::R_MIPS16_TLS_GOTTPREL:
539 case ELF::R_MIPS16_TLS_TPREL_HI16:
540 case ELF::R_MIPS16_TLS_TPREL_LO16:
541 llvm_unreachable("Unsupported MIPS16 relocation");
542 return true;
543 }
544}
545
546std::unique_ptr<MCObjectTargetWriter>
548 uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TT.getOS());
549 bool IsN64 = TT.isArch64Bit() && !IsN32;
550 bool HasRelocationAddend = TT.isArch64Bit();
551 return std::make_unique<MipsELFObjectWriter>(OSABI, HasRelocationAddend,
552 IsN64);
553}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define X(NUM, ENUM, NAME)
Definition ELF.h:856
static Error reportError(StringRef Message)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define I(x, y, z)
Definition MD5.cpp:57
static bool isMatchingReloc(unsigned MatchingType, const ELFRelocationEntry &R, const ELFRelocationEntry &X)
static unsigned getMatchingLoType(const ELFRelocationEntry &Reloc)
Determine the low relocation that matches the given relocation.
PowerPC TLS Dynamic Call Fixup
This file contains some templates that are useful if you are working with the STL at all.
static bool is64Bit(const char *name)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition MCFixup.h:61
void push_back(const T &Elt)
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ EM_MIPS
Definition ELF.h:146
@ STO_MIPS_MICROMIPS
Definition ELF.h:602
@ STB_LOCAL
Definition ELF.h:1412
@ STT_TLS
Definition ELF.h:1430
@ fixup_MICROMIPS_TLS_TPREL_LO16
@ fixup_MICROMIPS_TLS_TPREL_HI16
@ fixup_MICROMIPS_TLS_DTPREL_HI16
@ fixup_MICROMIPS_TLS_DTPREL_LO16
@ fixup_Mips_Branch_PCRel
This is an optimization pass for GlobalISel generic memory operations.
void stable_sort(R &&Range)
Definition STLExtras.h:2116
std::unique_ptr< MCObjectTargetWriter > createMipsELFObjectWriter(const Triple &TT, bool IsN32)
Construct a Mips ELF object writer.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
Definition MathExtras.h:189
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
@ FK_Data_8
A eight-byte fixup.
Definition MCFixup.h:37
@ FK_Data_1
A one-byte fixup.
Definition MCFixup.h:34
@ FK_Data_4
A four-byte fixup.
Definition MCFixup.h:36
@ FK_NONE
A no-op fixup.
Definition MCFixup.h:33
@ FK_Data_2
A two-byte fixup.
Definition MCFixup.h:35