diff options
Diffstat (limited to 'contrib/llvm-project/lld/MachO/Target.h')
-rw-r--r-- | contrib/llvm-project/lld/MachO/Target.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/llvm-project/lld/MachO/Target.h b/contrib/llvm-project/lld/MachO/Target.h index 597502275dee..ef54dbb80408 100644 --- a/contrib/llvm-project/lld/MachO/Target.h +++ b/contrib/llvm-project/lld/MachO/Target.h @@ -65,14 +65,19 @@ public: // on a level of address indirection. virtual void relaxGotLoad(uint8_t *loc, uint8_t type) const = 0; - virtual const RelocAttrs &getRelocAttrs(uint8_t type) const = 0; - virtual uint64_t getPageSize() const = 0; virtual void populateThunk(InputSection *thunk, Symbol *funcSym) { llvm_unreachable("target does not use thunks"); } + const RelocAttrs &getRelocAttrs(uint8_t type) const { + assert(type < relocAttrs.size() && "invalid relocation type"); + if (type >= relocAttrs.size()) + return invalidRelocAttrs; + return relocAttrs[type]; + } + bool hasAttr(uint8_t type, RelocAttrBits bit) const { return getRelocAttrs(type).hasAttr(bit); } @@ -111,6 +116,8 @@ public: uint8_t subtractorRelocType; uint8_t unsignedRelocType; + llvm::ArrayRef<RelocAttrs> relocAttrs; + // 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 |