#include "InputFiles.h"
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
#include "lld/Common/ErrorHandler.h"
#include "mach-o/compact_unwind_encoding.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/Endian.h"
usingnamespacellvm::MachO;
usingnamespacellvm::support::endian;
usingnamespacelld;
usingnamespacelld::macho;
namespace {
struct X86_64 : TargetInfo { … };
}
static constexpr std::array<RelocAttrs, 10> relocAttrsArray{ … };
static int pcrelOffset(uint8_t type) { … }
int64_t X86_64::getEmbeddedAddend(MemoryBufferRef mb, uint64_t offset,
relocation_info rel) const { … }
void X86_64::relocateOne(uint8_t *loc, const Reloc &r, uint64_t value,
uint64_t relocVA) const { … }
static void writeRipRelative(SymbolDiagnostic d, uint8_t *buf, uint64_t bufAddr,
uint64_t bufOff, uint64_t destAddr) { … }
static constexpr uint8_t stub[] = …;
void X86_64::writeStub(uint8_t *buf, const Symbol &sym,
uint64_t pointerVA) const { … }
static constexpr uint8_t stubHelperHeader[] = …;
void X86_64::writeStubHelperHeader(uint8_t *buf) const { … }
static constexpr uint8_t stubHelperEntry[] = …;
void X86_64::writeStubHelperEntry(uint8_t *buf, const Symbol &sym,
uint64_t entryAddr) const { … }
static constexpr uint8_t objcStubsFastCode[] = …;
void X86_64::writeObjCMsgSendStub(uint8_t *buf, Symbol *sym, uint64_t stubsAddr,
uint64_t &stubOffset, uint64_t selrefVA,
Symbol *objcMsgSend) const { … }
void X86_64::relaxGotLoad(uint8_t *loc, uint8_t type) const { … }
X86_64::X86_64() : … { … }
TargetInfo *macho::createX86_64TargetInfo() { … }
void X86_64::handleDtraceReloc(const Symbol *sym, const Reloc &r,
uint8_t *loc) const { … }