diff options
Diffstat (limited to 'lld/MachO/Target.h')
| -rw-r--r-- | lld/MachO/Target.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lld/MachO/Target.h b/lld/MachO/Target.h index 9c021c611f7b..09ff3c5639ea 100644 --- a/lld/MachO/Target.h +++ b/lld/MachO/Target.h @@ -14,6 +14,7 @@ #include "llvm/ADT/BitmaskEnum.h" #include "llvm/BinaryFormat/MachO.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/MemoryBuffer.h" #include <cstddef> @@ -27,6 +28,7 @@ class Symbol; class Defined; class DylibSymbol; class InputSection; +class ConcatInputSection; class TargetInfo { public: @@ -37,6 +39,7 @@ public: pageZeroSize = LP::pageZeroSize; headerSize = sizeof(typename LP::mach_header); wordSize = LP::wordSize; + p2WordSize = llvm::CTLog2<LP::wordSize>(); } virtual ~TargetInfo() = default; @@ -52,7 +55,7 @@ public: // details. virtual void writeStub(uint8_t *buf, const Symbol &) const = 0; virtual void writeStubHelperHeader(uint8_t *buf) const = 0; - virtual void writeStubHelperEntry(uint8_t *buf, const DylibSymbol &, + virtual void writeStubHelperEntry(uint8_t *buf, const Symbol &, uint64_t entryAddr) const = 0; // Symbols may be referenced via either the GOT or the stubs section, @@ -76,6 +79,9 @@ public: bool usesThunks() const { return thunkSize > 0; } + virtual void applyOptimizationHints(uint8_t *buf, const ConcatInputSection *, + llvm::ArrayRef<uint64_t>) const {}; + uint32_t magic; llvm::MachO::CPUType cpuType; uint32_t cpuSubtype; @@ -85,12 +91,17 @@ public: size_t stubSize; size_t stubHelperHeaderSize; size_t stubHelperEntrySize; + uint8_t p2WordSize; size_t wordSize; size_t thunkSize = 0; uint64_t forwardBranchRange = 0; uint64_t backwardBranchRange = 0; + uint32_t modeDwarfEncoding; + uint8_t subtractorRelocType; + uint8_t unsignedRelocType; + // We contrive this value as sufficiently far from any valid address that it // will always be out-of-range for any architecture. UINT64_MAX is not a // good choice because it is (a) only 1 away from wrapping to 0, and (b) the |
