LLVM 24.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,
33 MCValue Target,
34 unsigned Log2Size,
35 uint64_t &FixedValue);
36 void recordTLVPRelocation(MachObjectWriter *Writer,
37 const MCAssembler &Asm,
38 const MCFragment *Fragment,
39 const MCFixup &Fixup,
40 MCValue Target,
41 uint64_t &FixedValue);
42
43 void RecordX86Relocation(MachObjectWriter *Writer,
44 const MCAssembler &Asm,
45 const MCFragment *Fragment,
46 const MCFixup &Fixup,
47 MCValue Target,
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
57 void recordRelocation(MachObjectWriter *Writer, MCAssembler &Asm,
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
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 if (!A->isUndefined())
181 Value += Writer->getSymbolAddress(*A) -
182 (!A_Base ? 0 : Writer->getSymbolAddress(*A_Base));
183 if (!B->isUndefined())
184 Value -= Writer->getSymbolAddress(*B) -
185 (!B_Base ? 0 : Writer->getSymbolAddress(*B_Base));
186
187 if (!A_Base)
188 Index = A->getFragment()->getParent()->getOrdinal() + 1;
190
191 MachO::any_relocation_info MRE;
192 MRE.r_word0 = FixupOffset;
193 MRE.r_word1 =
194 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
195 Writer->addRelocation(A_Base, Fragment->getParent(), MRE);
196
197 if (B_Base)
198 RelSymbol = B_Base;
199 else
200 Index = B->getFragment()->getParent()->getOrdinal() + 1;
202 } else {
203 const MCSymbol *Symbol = Target.getAddSym();
204 if (Symbol->isTemporary() && Value) {
205 const MCSection &Sec = Symbol->getSection();
207 Symbol->setUsedInReloc();
208 }
209 RelSymbol = Writer->getAtom(*Symbol);
210
211 // Relocations inside debug sections always use local relocations when
212 // possible. This seems to be done because the debugger doesn't fully
213 // understand x86_64 relocation entries, and expects to find values that
214 // have already been fixed up.
215 if (Symbol->isInSection()) {
216 const MCSectionMachO &Section =
217 static_cast<const MCSectionMachO &>(*Fragment->getParent());
218 if (Section.hasAttribute(MachO::S_ATTR_DEBUG))
219 RelSymbol = nullptr;
220 }
221
222 // x86_64 almost always uses external relocations, except when there is no
223 // symbol to use as a base address (a local symbol with no preceding
224 // non-local symbol).
225 if (RelSymbol) {
226 // Add the local offset, if needed.
227 if (RelSymbol != Symbol)
228 Value += Asm.getSymbolOffset(*Symbol) - Asm.getSymbolOffset(*RelSymbol);
229 } else if (Symbol->isInSection() && !Symbol->isVariable()) {
230 // The index is the section ordinal (1-based).
231 Index = Symbol->getFragment()->getParent()->getOrdinal() + 1;
232 Value += Writer->getSymbolAddress(*Symbol);
233
234 if (IsPCRel)
235 Value -= FixupAddress + (1 << Log2Size);
236 } else if (Symbol->isVariable()) {
237 FixedValue = Writer->getSymbolAddress(*Symbol);
238 return;
239 } else {
240 reportError(Fixup.getLoc(),
241 "unsupported relocation of undefined symbol '" +
242 Symbol->getName() + "'");
243 return;
244 }
245
246 auto Specifier = Target.getSpecifier();
247 if (IsPCRel) {
248 if (IsRIPRel) {
249 if (Specifier == X86::S_GOTPCREL) {
250 // x86_64 distinguishes movq foo@GOTPCREL so that the linker can
251 // rewrite the movq to an leaq at link time if the symbol ends up in
252 // the same linkage unit.
255 else
257 } else if (Specifier == X86::S_TLVP) {
259 } else if (Specifier) {
260 reportError(Fixup.getLoc(),
261 "unsupported symbol modifier in relocation");
262 return;
263 } else {
265
266 // The Darwin x86_64 relocation format has a problem where it cannot
267 // encode an address (L<foo> + <constant>) which is outside the atom
268 // containing L<foo>. Generally, this shouldn't occur but it does
269 // happen when we have a RIPrel instruction with data following the
270 // relocation entry (e.g., movb $012, L0(%rip)). Even with the PCrel
271 // adjustment Darwin x86_64 uses, the offset is still negative and the
272 // linker has no way to recognize this.
273 //
274 // To work around this, Darwin uses several special relocation types
275 // to indicate the offsets. However, the specification or
276 // implementation of these seems to also be incomplete; they should
277 // adjust the addend as well based on the actual encoded instruction
278 // (the additional bias), but instead appear to just look at the final
279 // offset.
280 switch (-(Target.getConstant() + (1LL << Log2Size))) {
281 case 1: Type = MachO::X86_64_RELOC_SIGNED_1; break;
282 case 2: Type = MachO::X86_64_RELOC_SIGNED_2; break;
283 case 4: Type = MachO::X86_64_RELOC_SIGNED_4; break;
284 }
285 }
286 } else {
287 if (Specifier) {
288 reportError(Fixup.getLoc(),
289 "unsupported symbol modifier in branch relocation");
290 return;
291 }
292
294 }
295 } else {
296 if (Specifier == X86::S_GOT) {
298 } else if (Specifier == X86::S_GOTPCREL) {
299 // GOTPCREL is allowed as a modifier on non-PCrel instructions, in which
300 // case all we do is set the PCrel bit in the relocation entry; this is
301 // used with exception handling, for example. The source is required to
302 // include any necessary offset directly.
304 IsPCRel = 1;
305 } else if (Specifier == X86::S_TLVP) {
306 reportError(Fixup.getLoc(),
307 "TLVP symbol modifier should have been rip-rel");
308 return;
309 } else if (Specifier) {
310 reportError(Fixup.getLoc(),
311 "unsupported symbol modifier in relocation");
312 return;
313 } else {
315 if (Fixup.getKind() == X86::reloc_signed_4byte) {
317 Fixup.getLoc(),
318 "32-bit absolute addressing is not supported in 64-bit mode");
319 return;
320 }
321 }
322 }
323 }
324
325 // x86_64 always writes custom values into the fixups.
326 FixedValue = Value;
327
328 // struct relocation_info (8 bytes)
329 MachO::any_relocation_info MRE;
330 MRE.r_word0 = FixupOffset;
331 MRE.r_word1 = (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) |
332 (IsExtern << 27) | (Type << 28);
333 Writer->addRelocation(RelSymbol, Fragment->getParent(), MRE);
334}
335
336bool X86MachObjectWriter::recordScatteredRelocation(MachObjectWriter *Writer,
337 const MCAssembler &Asm,
338 const MCFragment *Fragment,
339 const MCFixup &Fixup,
340 MCValue Target,
341 unsigned Log2Size,
342 uint64_t &FixedValue) {
343 uint64_t OriginalFixedValue = FixedValue;
344 uint32_t FixupOffset = Asm.getFragmentOffset(*Fragment) + Fixup.getOffset();
345 unsigned IsPCRel = Fixup.isPCRel();
347
348 // See <reloc.h>.
349 auto *A = static_cast<const MCSymbolMachO *>(Target.getAddSym());
350 if (!A->getFragment()) {
351 reportError(Fixup.getLoc(),
352 "symbol '" + A->getName() +
353 "' can not be undefined in a subtraction expression");
354 return false;
355 }
356
357 uint32_t Value = Writer->getSymbolAddress(*A);
358 uint64_t SecAddr = Writer->getSectionAddress(A->getFragment()->getParent());
359 FixedValue += SecAddr;
360 uint32_t Value2 = 0;
361
362 if (const MCSymbol *SB = Target.getSubSym()) {
363 if (!SB->getFragment()) {
364 reportError(Fixup.getLoc(),
365 "symbol '" + SB->getName() +
366 "' can not be undefined in a subtraction expression");
367 return false;
368 }
369
370 // Select the appropriate difference relocation type.
371 //
372 // Note that there is no longer any semantic difference between these two
373 // relocation types from the linkers point of view, this is done solely for
374 // pedantic compatibility with 'as'.
375 Type = A->isExternal() ? (unsigned)MachO::GENERIC_RELOC_SECTDIFF
376 : (unsigned)MachO::GENERIC_RELOC_LOCAL_SECTDIFF;
377 Value2 = Writer->getSymbolAddress(*SB);
378 FixedValue -= Writer->getSectionAddress(SB->getFragment()->getParent());
379 }
380
381 // Relocations are written out in reverse order, so the PAIR comes first.
384 // If the offset is too large to fit in a scattered relocation,
385 // we're hosed. It's an unfortunate limitation of the MachO format.
386 if (FixupOffset > 0xffffff) {
387 char Buffer[32];
388 format("0x%x", FixupOffset).snprint(Buffer, sizeof(Buffer));
389 reportError(Fixup.getLoc(), Twine("Section too large, can't encode "
390 "r_address (") +
391 Buffer +
392 ") into 24 bits of scattered "
393 "relocation entry.");
394 return false;
395 }
396
397 MachO::any_relocation_info MRE;
398 MRE.r_word0 = ((0 << 0) | // r_address
399 (MachO::GENERIC_RELOC_PAIR << 24) | // r_type
400 (Log2Size << 28) |
401 (IsPCRel << 30) |
403 MRE.r_word1 = Value2;
404 Writer->addRelocation(nullptr, Fragment->getParent(), MRE);
405 } else {
406 // If the offset is more than 24-bits, it won't fit in a scattered
407 // relocation offset field, so we fall back to using a non-scattered
408 // relocation. This is a bit risky, as if the offset reaches out of
409 // the block and the linker is doing scattered loading on this
410 // symbol, things can go badly.
411 //
412 // Required for 'as' compatibility.
413 if (FixupOffset > 0xffffff) {
414 FixedValue = OriginalFixedValue;
415 return false;
416 }
417 }
418
419 MachO::any_relocation_info MRE;
420 MRE.r_word0 = ((FixupOffset << 0) |
421 (Type << 24) |
422 (Log2Size << 28) |
423 (IsPCRel << 30) |
425 MRE.r_word1 = Value;
426 Writer->addRelocation(nullptr, Fragment->getParent(), MRE);
427 return true;
428}
429
430void X86MachObjectWriter::recordTLVPRelocation(MachObjectWriter *Writer,
431 const MCAssembler &Asm,
432 const MCFragment *Fragment,
433 const MCFixup &Fixup,
434 MCValue Target,
435 uint64_t &FixedValue) {
436 const MCSymbol *SymA = Target.getAddSym();
437 assert(Target.getSpecifier() == X86::S_TLVP && !is64Bit() &&
438 "Should only be called with a 32-bit TLVP relocation!");
439
440 unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
441 uint32_t Value = Asm.getFragmentOffset(*Fragment) + Fixup.getOffset();
442 unsigned IsPCRel = 0;
443
444 // We're only going to have a second symbol in pic mode and it'll be a
445 // subtraction from the picbase. For 32-bit pic the addend is the difference
446 // between the picbase and the next address. For 32-bit static the addend is
447 // zero.
448 if (auto *SymB = Target.getSubSym()) {
449 // If this is a subtraction then we're pcrel.
450 uint32_t FixupAddress =
451 Writer->getFragmentAddress(Asm, Fragment) + Fixup.getOffset();
452 IsPCRel = 1;
453 FixedValue =
454 FixupAddress - Writer->getSymbolAddress(*SymB) + Target.getConstant();
455 FixedValue += 1ULL << Log2Size;
456 } else {
457 FixedValue = 0;
458 }
459
460 // struct relocation_info (8 bytes)
461 MachO::any_relocation_info MRE;
462 MRE.r_word0 = Value;
463 MRE.r_word1 =
464 (IsPCRel << 24) | (Log2Size << 25) | (MachO::GENERIC_RELOC_TLV << 28);
465 Writer->addRelocation(SymA, Fragment->getParent(), MRE);
466}
467
468void X86MachObjectWriter::RecordX86Relocation(MachObjectWriter *Writer,
469 const MCAssembler &Asm,
470 const MCFragment *Fragment,
471 const MCFixup &Fixup,
472 MCValue Target,
473 uint64_t &FixedValue) {
474 unsigned IsPCRel = Fixup.isPCRel();
475 unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind());
476 const MCSymbol *A = Target.getAddSym();
477
478 // If this is a 32-bit TLVP reloc it's handled a bit differently.
479 if (A && Target.getSpecifier() == X86::S_TLVP) {
480 recordTLVPRelocation(Writer, Asm, Fragment, Fixup, Target, FixedValue);
481 return;
482 }
483
484 // If this is a difference or a defined symbol plus an offset, then we need a
485 // scattered relocation entry. Differences always require scattered
486 // relocations.
487 if (Target.getSubSym()) {
488 recordScatteredRelocation(Writer, Asm, Fragment, Fixup, Target, Log2Size,
489 FixedValue);
490 return;
491 }
492
493 // If this is an internal relocation with an offset, it also needs a scattered
494 // relocation entry.
495 uint32_t Offset = Target.getConstant();
496 if (IsPCRel)
497 Offset += 1 << Log2Size;
498
499 // Try to record the scattered relocation if needed. Fall back to non
500 // scattered if necessary (see comments in recordScatteredRelocation()
501 // for details).
502 if (Offset && A && !Writer->doesSymbolRequireExternRelocation(*A) &&
503 recordScatteredRelocation(Writer, Asm, Fragment, Fixup, Target, Log2Size,
504 FixedValue))
505 return;
506
507 // See <reloc.h>.
508 uint32_t FixupOffset = Asm.getFragmentOffset(*Fragment) + Fixup.getOffset();
509 unsigned Index = 0;
510 unsigned Type = 0;
511 const MCSymbol *RelSymbol = nullptr;
512
513 if (Target.isAbsolute()) { // constant
514 // SymbolNum of 0 indicates the absolute section.
515 //
516 // FIXME: Currently, these are never generated (see code below). I cannot
517 // find a case where they are actually emitted.
519 } else {
520 assert(A && "Unknown symbol data");
521
522 // Resolve constant variables.
523 if (A->isVariable()) {
524 MCValue Val;
525 bool Relocatable =
526 A->getVariableValue()->evaluateAsRelocatable(Val, &Asm);
527 int64_t Res = Val.getConstant();
528 bool isAbs = Val.isAbsolute();
529 if (Relocatable && Val.getAddSym() && Val.getSubSym()) {
530 Res += Writer->getSymbolAddress(*Val.getAddSym()) -
531 Writer->getSymbolAddress(*Val.getSubSym());
532 isAbs = true;
533 }
534 if (isAbs) {
535 FixedValue = Res;
536 return;
537 }
538 }
539
540 // Check whether we need an external or internal relocation.
541 if (Writer->doesSymbolRequireExternRelocation(*A)) {
542 RelSymbol = A;
543 // For external relocations, make sure to offset the fixup value to
544 // compensate for the addend of the symbol address, if it was
545 // undefined. This occurs with weak definitions, for example.
546 if (!A->isUndefined())
547 FixedValue -= Asm.getSymbolOffset(*A);
548 } else {
549 // The index is the section ordinal (1-based).
550 const MCSection &Sec = A->getSection();
551 Index = Sec.getOrdinal() + 1;
552 FixedValue += Writer->getSectionAddress(&Sec);
553 }
554 if (IsPCRel)
555 FixedValue -= Writer->getSectionAddress(Fragment->getParent());
556
558 }
559
560 // struct relocation_info (8 bytes)
561 MachO::any_relocation_info MRE;
562 MRE.r_word0 = FixupOffset;
563 MRE.r_word1 =
564 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
565 Writer->addRelocation(RelSymbol, Fragment->getParent(), MRE);
566}
567
568std::unique_ptr<MCObjectTargetWriter>
570 uint32_t CPUSubtype) {
571 return std::make_unique<X86MachObjectWriter>(Is64Bit, CPUType, CPUSubtype);
572}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
uint64_t uint64_t
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")
static bool is64Bit(const char *name)
static bool isFixupKindRIPRel(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:65
unsigned getOrdinal() const
Definition MCSection.h:673
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
void addRelocation(const MCSymbol *RelSymbol, const MCSection *Sec, MachO::any_relocation_info &MRE)
const MCSymbol & findAliasedSymbol(const MCSymbol &Sym) const
uint64_t getSectionAddress(const MCSection *Sec) const
const MCSymbol * getAtom(const MCSymbol &S) const
uint64_t getSymbolAddress(const MCSymbol &S) const
Target - Wrapper for Target specific information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ R_SCATTERED
Definition MachO.h:398
constexpr uint32_t S_ATTR_DEBUG
A debug section.
Definition MachO.h:204
@ X86_64_RELOC_UNSIGNED
Definition MachO.h:536
@ X86_64_RELOC_SIGNED
Definition MachO.h:537
@ X86_64_RELOC_GOT
Definition MachO.h:540
@ GENERIC_RELOC_LOCAL_SECTDIFF
Definition MachO.h:410
@ X86_64_RELOC_GOT_LOAD
Definition MachO.h:539
@ X86_64_RELOC_BRANCH
Definition MachO.h:538
@ X86_64_RELOC_SIGNED_2
Definition MachO.h:543
@ GENERIC_RELOC_PAIR
Definition MachO.h:407
@ GENERIC_RELOC_VANILLA
Definition MachO.h:406
@ X86_64_RELOC_TLV
Definition MachO.h:545
@ GENERIC_RELOC_TLV
Definition MachO.h:411
@ X86_64_RELOC_SIGNED_4
Definition MachO.h:544
@ GENERIC_RELOC_SECTDIFF
Definition MachO.h:408
@ X86_64_RELOC_SUBTRACTOR
Definition MachO.h:541
@ X86_64_RELOC_SIGNED_1
Definition MachO.h:542
@ reloc_riprel_4byte_movq_load_rex2
@ reloc_signed_4byte_relax
@ reloc_branch_4byte_pcrel
@ reloc_riprel_4byte_relax
@ reloc_riprel_4byte_relax_evex
@ reloc_riprel_4byte_relax_rex
@ reloc_riprel_4byte_movq_load
@ reloc_riprel_4byte_relax_rex2
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:577
static unsigned getFixupKindLog2Size(unsigned Kind)
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
Definition InstrProf.h:143
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition Format.h:102
@ FK_Data_8
A eight-byte fixup.
Definition MCFixup.h:41
@ FK_Data_1
A one-byte fixup.
Definition MCFixup.h:38
@ FK_Data_4
A four-byte fixup.
Definition MCFixup.h:40
@ FK_Data_2
A two-byte fixup.
Definition MCFixup.h:39
std::unique_ptr< MCObjectTargetWriter > createX86MachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct an X86 Mach-O object writer.