LLVM 22.0.0git
X86MachObjectWriter.cpp
Go to the documentation of this file.
1//===-- X86MachObjectWriter.cpp - X86 Mach-O 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/Twine.h"
14#include "llvm/MC/MCAsmInfo.h"
16#include "llvm/MC/MCAssembler.h"
17#include "llvm/MC/MCContext.h"
21#include "llvm/MC/MCValue.h"
23#include "llvm/Support/Format.h"
24
25using namespace llvm;
26
27namespace {
28class X86MachObjectWriter : public MCMachObjectTargetWriter {
29 bool recordScatteredRelocation(MachObjectWriter *Writer,
30 const MCAssembler &Asm,
31 const MCFragment *Fragment,
32 const MCFixup &Fixup,
34 unsigned Log2Size,
35 uint64_t &FixedValue);
36 void recordTLVPRelocation(MachObjectWriter *Writer,
37 const MCAssembler &Asm,
38 const MCFragment *Fragment,
39 const MCFixup &Fixup,
41 uint64_t &FixedValue);
42
43 void RecordX86Relocation(MachObjectWriter *Writer,
44 const MCAssembler &Asm,
45 const MCFragment *Fragment,
46 const MCFixup &Fixup,
48 uint64_t &FixedValue);
49 void RecordX86_64Relocation(MachObjectWriter *Writer, MCAssembler &Asm,
50 const MCFragment *Fragment, const MCFixup &Fixup,
51 MCValue Target, uint64_t &FixedValue);
52
53public:
54 X86MachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
55 : MCMachObjectTargetWriter(Is64Bit, CPUType, CPUSubtype) {}
56
58 const MCFragment *Fragment, const MCFixup &Fixup,
59 MCValue Target, uint64_t &FixedValue) override {
60 if (Writer->is64Bit())
61 RecordX86_64Relocation(Writer, Asm, Fragment, Fixup, Target, FixedValue);
62 else
63 RecordX86Relocation(Writer, Asm, Fragment, Fixup, Target, FixedValue);
64 }
65};
66} // namespace
67
68static bool isFixupKindRIPRel(unsigned Kind) {
69 return Kind == X86::reloc_riprel_4byte ||
76}
77
78static unsigned getFixupKindLog2Size(unsigned Kind) {
79 switch (Kind) {
80 default:
81 llvm_unreachable("invalid fixup kind!");
82 case FK_Data_1: return 0;
83 case FK_Data_2: return 1;
84 // FIXME: Remove these!!!
95 case FK_Data_4: return 2;
96 case FK_Data_8: return 3;
97 }
98}
99
100void X86MachObjectWriter::RecordX86_64Relocation(
101 MachObjectWriter *Writer, MCAssembler &Asm, const MCFragment *Fragment,
102 const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue) {
103 unsigned IsPCRel = Fixup.isPCRel();
104 unsigned IsRIPRel = isFixupKindRIPRel(Fixup.getKind());
105 unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
106
107 // See <reloc.h>.
108 uint32_t FixupOffset = Asm.getFragmentOffset(*Fragment) + Fixup.getOffset();
109 uint32_t FixupAddress =
110 Writer->getFragmentAddress(Asm, Fragment) + Fixup.getOffset();
111 int64_t Value = 0;
112 unsigned Index = 0;
113 unsigned IsExtern = 0;
114 unsigned Type = 0;
115 const MCSymbol *RelSymbol = nullptr;
116
117 Value = Target.getConstant();
118
119 if (IsPCRel) {
120 // Compensate for the relocation offset, Darwin x86_64 relocations only have
121 // the addend and appear to have attempted to define it to be the actual
122 // expression addend without the PCrel bias. However, instructions with data
123 // following the relocation are not accommodated for (see comment below
124 // regarding SIGNED{1,2,4}), so it isn't exactly that either.
125 Value += 1LL << Log2Size;
126 }
127
128 if (Target.isAbsolute()) { // constant
129 // SymbolNum of 0 indicates the absolute section.
131
132 // FIXME: I believe this is broken, I don't think the linker can understand
133 // it. I think it would require a local relocation, but I'm not sure if that
134 // would work either. The official way to get an absolute PCrel relocation
135 // is to use an absolute symbol (which we don't support yet).
136 if (IsPCRel) {
137 IsExtern = 1;
139 }
140 } else if (Target.getSubSym()) { // A - B + constant
141 const MCSymbol *A = Target.getAddSym();
142 if (A->isTemporary())
143 A = &Writer->findAliasedSymbol(*A);
144 const MCSymbol *A_Base = Writer->getAtom(*A);
145
146 const MCSymbol *B = Target.getSubSym();
147 if (B->isTemporary())
148 B = &Writer->findAliasedSymbol(*B);
149 const MCSymbol *B_Base = Writer->getAtom(*B);
150
151 // Neither symbol can be modified.
152 if (Target.getSpecifier()) {
153 reportError(Fixup.getLoc(), "unsupported relocation of modified symbol");
154 return;
155 }
156
157 // We don't support PCrel relocations of differences. Darwin 'as' doesn't
158 // implement most of these correctly.
159 if (IsPCRel) {
160 reportError(Fixup.getLoc(),
161 "unsupported pc-relative relocation of difference");
162 return;
163 }
164
165 // The support for the situation where one or both of the symbols would
166 // require a local relocation is handled just like if the symbols were
167 // external. This is certainly used in the case of debug sections where the
168 // section has only temporary symbols and thus the symbols don't have base
169 // symbols. This is encoded using the section ordinal and non-extern
170 // relocation entries.
171
172 // Darwin 'as' doesn't emit correct relocations for this (it ends up with a
173 // single SIGNED relocation); reject it for now. Except the case where both
174 // symbols don't have a base, equal but both NULL.
175 if (A_Base == B_Base && A_Base) {
176 reportError(Fixup.getLoc(), "unsupported relocation with identical base");
177 return;
178 }
179
180 // A subtraction expression where either symbol is undefined is a
181 // non-relocatable expression.
182 if (A->isUndefined() || B->isUndefined()) {
183 StringRef Name = A->isUndefined() ? A->getName() : B->getName();
185 Fixup.getLoc(),
186 "unsupported relocation with subtraction expression, symbol '" +
187 Name + "' can not be undefined in a subtraction expression");
188 return;
189 }
190
191 Value += Writer->getSymbolAddress(*A) -
192 (!A_Base ? 0 : Writer->getSymbolAddress(*A_Base));
193 Value -= Writer->getSymbolAddress(*B) -
194 (!B_Base ? 0 : Writer->getSymbolAddress(*B_Base));
195
196 if (!A_Base)
197 Index = A->getFragment()->getParent()->getOrdinal() + 1;
199
201 MRE.r_word0 = FixupOffset;
202 MRE.r_word1 =
203 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
204 Writer->addRelocation(A_Base, Fragment->getParent(), MRE);
205
206 if (B_Base)
207 RelSymbol = B_Base;
208 else
209 Index = B->getFragment()->getParent()->getOrdinal() + 1;
211 } else {
212 const MCSymbol *Symbol = Target.getAddSym();
213 if (Symbol->isTemporary() && Value) {
214 const MCSection &Sec = Symbol->getSection();
216 Symbol->setUsedInReloc();
217 }
218 RelSymbol = Writer->getAtom(*Symbol);
219
220 // Relocations inside debug sections always use local relocations when
221 // possible. This seems to be done because the debugger doesn't fully
222 // understand x86_64 relocation entries, and expects to find values that
223 // have already been fixed up.
224 if (Symbol->isInSection()) {
225 const MCSectionMachO &Section =
226 static_cast<const MCSectionMachO &>(*Fragment->getParent());
227 if (Section.hasAttribute(MachO::S_ATTR_DEBUG))
228 RelSymbol = nullptr;
229 }
230
231 // x86_64 almost always uses external relocations, except when there is no
232 // symbol to use as a base address (a local symbol with no preceding
233 // non-local symbol).
234 if (RelSymbol) {
235 // Add the local offset, if needed.
236 if (RelSymbol != Symbol)
237 Value += Asm.getSymbolOffset(*Symbol) - Asm.getSymbolOffset(*RelSymbol);
238 } else if (Symbol->isInSection() && !Symbol->isVariable()) {
239 // The index is the section ordinal (1-based).
240 Index = Symbol->getFragment()->getParent()->getOrdinal() + 1;
241 Value += Writer->getSymbolAddress(*Symbol);
242
243 if (IsPCRel)
244 Value -= FixupAddress + (1 << Log2Size);
245 } else if (Symbol->isVariable()) {
246 FixedValue = Writer->getSymbolAddress(*Symbol);
247 return;
248 } else {
249 reportError(Fixup.getLoc(),
250 "unsupported relocation of undefined symbol '" +
251 Symbol->getName() + "'");
252 return;
253 }
254
255 auto Specifier = Target.getSpecifier();
256 if (IsPCRel) {
257 if (IsRIPRel) {
258 if (Specifier == X86::S_GOTPCREL) {
259 // x86_64 distinguishes movq foo@GOTPCREL so that the linker can
260 // rewrite the movq to an leaq at link time if the symbol ends up in
261 // the same linkage unit.
264 else
266 } else if (Specifier == X86::S_TLVP) {
268 } else if (Specifier) {
269 reportError(Fixup.getLoc(),
270 "unsupported symbol modifier in relocation");
271 return;
272 } else {
274
275 // The Darwin x86_64 relocation format has a problem where it cannot
276 // encode an address (L<foo> + <constant>) which is outside the atom
277 // containing L<foo>. Generally, this shouldn't occur but it does
278 // happen when we have a RIPrel instruction with data following the
279 // relocation entry (e.g., movb $012, L0(%rip)). Even with the PCrel
280 // adjustment Darwin x86_64 uses, the offset is still negative and the
281 // linker has no way to recognize this.
282 //
283 // To work around this, Darwin uses several special relocation types
284 // to indicate the offsets. However, the specification or
285 // implementation of these seems to also be incomplete; they should
286 // adjust the addend as well based on the actual encoded instruction
287 // (the additional bias), but instead appear to just look at the final
288 // offset.
289 switch (-(Target.getConstant() + (1LL << Log2Size))) {
290 case 1: Type = MachO::X86_64_RELOC_SIGNED_1; break;
291 case 2: Type = MachO::X86_64_RELOC_SIGNED_2; break;
292 case 4: Type = MachO::X86_64_RELOC_SIGNED_4; break;
293 }
294 }
295 } else {
296 if (Specifier) {
297 reportError(Fixup.getLoc(),
298 "unsupported symbol modifier in branch relocation");
299 return;
300 }
301
303 }
304 } else {
305 if (Specifier == X86::S_GOT) {
307 } else if (Specifier == X86::S_GOTPCREL) {
308 // GOTPCREL is allowed as a modifier on non-PCrel instructions, in which
309 // case all we do is set the PCrel bit in the relocation entry; this is
310 // used with exception handling, for example. The source is required to
311 // include any necessary offset directly.
313 IsPCRel = 1;
314 } else if (Specifier == X86::S_TLVP) {
315 reportError(Fixup.getLoc(),
316 "TLVP symbol modifier should have been rip-rel");
317 return;
318 } else if (Specifier) {
319 reportError(Fixup.getLoc(),
320 "unsupported symbol modifier in relocation");
321 return;
322 } else {
324 if (Fixup.getKind() == X86::reloc_signed_4byte) {
326 Fixup.getLoc(),
327 "32-bit absolute addressing is not supported in 64-bit mode");
328 return;
329 }
330 }
331 }
332 }
333
334 // x86_64 always writes custom values into the fixups.
335 FixedValue = Value;
336
337 // struct relocation_info (8 bytes)
339 MRE.r_word0 = FixupOffset;
340 MRE.r_word1 = (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) |
341 (IsExtern << 27) | (Type << 28);
342 Writer->addRelocation(RelSymbol, Fragment->getParent(), MRE);
343}
344
345bool X86MachObjectWriter::recordScatteredRelocation(MachObjectWriter *Writer,
346 const MCAssembler &Asm,
347 const MCFragment *Fragment,
348 const MCFixup &Fixup,
350 unsigned Log2Size,
351 uint64_t &FixedValue) {
352 uint64_t OriginalFixedValue = FixedValue;
353 uint32_t FixupOffset = Asm.getFragmentOffset(*Fragment) + Fixup.getOffset();
354 unsigned IsPCRel = Fixup.isPCRel();
356
357 // See <reloc.h>.
358 auto *A = static_cast<const MCSymbolMachO *>(Target.getAddSym());
359 if (!A->getFragment()) {
360 reportError(Fixup.getLoc(),
361 "symbol '" + A->getName() +
362 "' can not be undefined in a subtraction expression");
363 return false;
364 }
365
366 uint32_t Value = Writer->getSymbolAddress(*A);
367 uint64_t SecAddr = Writer->getSectionAddress(A->getFragment()->getParent());
368 FixedValue += SecAddr;
369 uint32_t Value2 = 0;
370
371 if (const MCSymbol *SB = Target.getSubSym()) {
372 if (!SB->getFragment()) {
373 reportError(Fixup.getLoc(),
374 "symbol '" + SB->getName() +
375 "' can not be undefined in a subtraction expression");
376 return false;
377 }
378
379 // Select the appropriate difference relocation type.
380 //
381 // Note that there is no longer any semantic difference between these two
382 // relocation types from the linkers point of view, this is done solely for
383 // pedantic compatibility with 'as'.
386 Value2 = Writer->getSymbolAddress(*SB);
387 FixedValue -= Writer->getSectionAddress(SB->getFragment()->getParent());
388 }
389
390 // Relocations are written out in reverse order, so the PAIR comes first.
393 // If the offset is too large to fit in a scattered relocation,
394 // we're hosed. It's an unfortunate limitation of the MachO format.
395 if (FixupOffset > 0xffffff) {
396 char Buffer[32];
397 format("0x%x", FixupOffset).print(Buffer, sizeof(Buffer));
398 reportError(Fixup.getLoc(), Twine("Section too large, can't encode "
399 "r_address (") +
400 Buffer +
401 ") into 24 bits of scattered "
402 "relocation entry.");
403 return false;
404 }
405
407 MRE.r_word0 = ((0 << 0) | // r_address
408 (MachO::GENERIC_RELOC_PAIR << 24) | // r_type
409 (Log2Size << 28) |
410 (IsPCRel << 30) |
412 MRE.r_word1 = Value2;
413 Writer->addRelocation(nullptr, Fragment->getParent(), MRE);
414 } else {
415 // If the offset is more than 24-bits, it won't fit in a scattered
416 // relocation offset field, so we fall back to using a non-scattered
417 // relocation. This is a bit risky, as if the offset reaches out of
418 // the block and the linker is doing scattered loading on this
419 // symbol, things can go badly.
420 //
421 // Required for 'as' compatibility.
422 if (FixupOffset > 0xffffff) {
423 FixedValue = OriginalFixedValue;
424 return false;
425 }
426 }
427
429 MRE.r_word0 = ((FixupOffset << 0) |
430 (Type << 24) |
431 (Log2Size << 28) |
432 (IsPCRel << 30) |
434 MRE.r_word1 = Value;
435 Writer->addRelocation(nullptr, Fragment->getParent(), MRE);
436 return true;
437}
438
439void X86MachObjectWriter::recordTLVPRelocation(MachObjectWriter *Writer,
440 const MCAssembler &Asm,
441 const MCFragment *Fragment,
442 const MCFixup &Fixup,
444 uint64_t &FixedValue) {
445 const MCSymbol *SymA = Target.getAddSym();
446 assert(Target.getSpecifier() == X86::S_TLVP && !is64Bit() &&
447 "Should only be called with a 32-bit TLVP relocation!");
448
449 unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
450 uint32_t Value = Asm.getFragmentOffset(*Fragment) + Fixup.getOffset();
451 unsigned IsPCRel = 0;
452
453 // We're only going to have a second symbol in pic mode and it'll be a
454 // subtraction from the picbase. For 32-bit pic the addend is the difference
455 // between the picbase and the next address. For 32-bit static the addend is
456 // zero.
457 if (auto *SymB = Target.getSubSym()) {
458 // If this is a subtraction then we're pcrel.
459 uint32_t FixupAddress =
460 Writer->getFragmentAddress(Asm, Fragment) + Fixup.getOffset();
461 IsPCRel = 1;
462 FixedValue =
463 FixupAddress - Writer->getSymbolAddress(*SymB) + Target.getConstant();
464 FixedValue += 1ULL << Log2Size;
465 } else {
466 FixedValue = 0;
467 }
468
469 // struct relocation_info (8 bytes)
471 MRE.r_word0 = Value;
472 MRE.r_word1 =
473 (IsPCRel << 24) | (Log2Size << 25) | (MachO::GENERIC_RELOC_TLV << 28);
474 Writer->addRelocation(SymA, Fragment->getParent(), MRE);
475}
476
477void X86MachObjectWriter::RecordX86Relocation(MachObjectWriter *Writer,
478 const MCAssembler &Asm,
479 const MCFragment *Fragment,
480 const MCFixup &Fixup,
482 uint64_t &FixedValue) {
483 unsigned IsPCRel = Fixup.isPCRel();
484 unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
485 const MCSymbol *A = Target.getAddSym();
486
487 // If this is a 32-bit TLVP reloc it's handled a bit differently.
488 if (A && Target.getSpecifier() == X86::S_TLVP) {
489 recordTLVPRelocation(Writer, Asm, Fragment, Fixup, Target, FixedValue);
490 return;
491 }
492
493 // If this is a difference or a defined symbol plus an offset, then we need a
494 // scattered relocation entry. Differences always require scattered
495 // relocations.
496 if (Target.getSubSym()) {
497 recordScatteredRelocation(Writer, Asm, Fragment, Fixup, Target, Log2Size,
498 FixedValue);
499 return;
500 }
501
502 // If this is an internal relocation with an offset, it also needs a scattered
503 // relocation entry.
504 uint32_t Offset = Target.getConstant();
505 if (IsPCRel)
506 Offset += 1 << Log2Size;
507
508 // Try to record the scattered relocation if needed. Fall back to non
509 // scattered if necessary (see comments in recordScatteredRelocation()
510 // for details).
511 if (Offset && A && !Writer->doesSymbolRequireExternRelocation(*A) &&
512 recordScatteredRelocation(Writer, Asm, Fragment, Fixup, Target, Log2Size,
513 FixedValue))
514 return;
515
516 // See <reloc.h>.
517 uint32_t FixupOffset = Asm.getFragmentOffset(*Fragment) + Fixup.getOffset();
518 unsigned Index = 0;
519 unsigned Type = 0;
520 const MCSymbol *RelSymbol = nullptr;
521
522 if (Target.isAbsolute()) { // constant
523 // SymbolNum of 0 indicates the absolute section.
524 //
525 // FIXME: Currently, these are never generated (see code below). I cannot
526 // find a case where they are actually emitted.
528 } else {
529 assert(A && "Unknown symbol data");
530
531 // Resolve constant variables.
532 if (A->isVariable()) {
533 MCValue Val;
534 bool Relocatable =
535 A->getVariableValue()->evaluateAsRelocatable(Val, &Asm);
536 int64_t Res = Val.getConstant();
537 bool isAbs = Val.isAbsolute();
538 if (Relocatable && Val.getAddSym() && Val.getSubSym()) {
539 Res += Writer->getSymbolAddress(*Val.getAddSym()) -
540 Writer->getSymbolAddress(*Val.getSubSym());
541 isAbs = true;
542 }
543 if (isAbs) {
544 FixedValue = Res;
545 return;
546 }
547 }
548
549 // Check whether we need an external or internal relocation.
550 if (Writer->doesSymbolRequireExternRelocation(*A)) {
551 RelSymbol = A;
552 // For external relocations, make sure to offset the fixup value to
553 // compensate for the addend of the symbol address, if it was
554 // undefined. This occurs with weak definitions, for example.
555 if (!A->isUndefined())
556 FixedValue -= Asm.getSymbolOffset(*A);
557 } else {
558 // The index is the section ordinal (1-based).
559 const MCSection &Sec = A->getSection();
560 Index = Sec.getOrdinal() + 1;
561 FixedValue += Writer->getSectionAddress(&Sec);
562 }
563 if (IsPCRel)
564 FixedValue -= Writer->getSectionAddress(Fragment->getParent());
565
567 }
568
569 // struct relocation_info (8 bytes)
571 MRE.r_word0 = FixupOffset;
572 MRE.r_word1 =
573 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
574 Writer->addRelocation(RelSymbol, Fragment->getParent(), MRE);
575}
576
577std::unique_ptr<MCObjectTargetWriter>
579 uint32_t CPUSubtype) {
580 return std::make_unique<X86MachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
581}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static Error reportError(StringRef Message)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
std::string Name
PowerPC TLS Dynamic Call Fixup
static bool is64Bit(const char *name)
static bool isFixupKindRIPRel(unsigned Kind)
static unsigned getFixupKindLog2Size(unsigned Kind)
static bool isSectionAtomizableBySymbols(const MCSection &Section)
True if the section is atomized using the symbols in it.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:61
MCSection * getParent() const
Definition: MCSection.h:158
virtual void recordRelocation(MachObjectWriter *Writer, MCAssembler &Asm, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue)=0
This represents a section on a Mach-O system (used by Mac OS X).
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:496
unsigned getOrdinal() const
Definition: MCSection.h:588
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
const MCSymbol * getAddSym() const
Definition: MCValue.h:49
int64_t getConstant() const
Definition: MCValue.h:44
const MCSymbol * getSubSym() const
Definition: MCValue.h:51
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
Definition: MCValue.h:54
bool doesSymbolRequireExternRelocation(const MCSymbol &S)
uint64_t getFragmentAddress(const MCAssembler &Asm, const MCFragment *Fragment) const
uint64_t getSectionAddress(const MCSection *Sec) const
void addRelocation(const MCSymbol *RelSymbol, const MCSection *Sec, MachO::any_relocation_info &MRE)
const MCSymbol & findAliasedSymbol(const MCSymbol &Sym) const
const MCSymbol * getAtom(const MCSymbol &S) const
uint64_t getSymbolAddress(const MCSymbol &S) const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
Target - Wrapper for Target specific information.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:82
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
LLVM Value Representation.
Definition: Value.h:75
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ S_ATTR_DEBUG
S_ATTR_DEBUG - A debug section.
Definition: MachO.h:207
@ R_SCATTERED
Definition: MachO.h:402
@ X86_64_RELOC_UNSIGNED
Definition: MachO.h:483
@ X86_64_RELOC_SIGNED
Definition: MachO.h:484
@ X86_64_RELOC_GOT
Definition: MachO.h:487
@ GENERIC_RELOC_LOCAL_SECTDIFF
Definition: MachO.h:414
@ X86_64_RELOC_GOT_LOAD
Definition: MachO.h:486
@ X86_64_RELOC_BRANCH
Definition: MachO.h:485
@ X86_64_RELOC_SIGNED_2
Definition: MachO.h:490
@ GENERIC_RELOC_PAIR
Definition: MachO.h:411
@ GENERIC_RELOC_VANILLA
Definition: MachO.h:410
@ X86_64_RELOC_TLV
Definition: MachO.h:492
@ GENERIC_RELOC_TLV
Definition: MachO.h:415
@ X86_64_RELOC_SIGNED_4
Definition: MachO.h:491
@ GENERIC_RELOC_SECTDIFF
Definition: MachO.h:412
@ X86_64_RELOC_SUBTRACTOR
Definition: MachO.h:488
@ X86_64_RELOC_SIGNED_1
Definition: MachO.h:489
@ reloc_riprel_4byte_movq_load_rex2
Definition: X86FixupKinds.h:19
@ reloc_signed_4byte_relax
Definition: X86FixupKinds.h:33
@ reloc_branch_4byte_pcrel
Definition: X86FixupKinds.h:38
@ reloc_riprel_4byte_relax
Definition: X86FixupKinds.h:21
@ reloc_riprel_4byte_relax_evex
Definition: X86FixupKinds.h:27
@ reloc_signed_4byte
Definition: X86FixupKinds.h:30
@ reloc_riprel_4byte_relax_rex
Definition: X86FixupKinds.h:23
@ reloc_riprel_4byte_movq_load
Definition: X86FixupKinds.h:18
@ reloc_riprel_4byte
Definition: X86FixupKinds.h:17
@ reloc_riprel_4byte_relax_rex2
Definition: X86FixupKinds.h:25
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:477
@ 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_Data_2
A two-byte fixup.
Definition: MCFixup.h:35
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:126
std::unique_ptr< MCObjectTargetWriter > createX86MachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct an X86 Mach-O object writer.