diff --git a/lld/MachO/Arch/ARM64.cpp b/lld/MachO/Arch/ARM64.cpp --- a/lld/MachO/Arch/ARM64.cpp +++ b/lld/MachO/Arch/ARM64.cpp @@ -55,8 +55,8 @@ const RelocAttrs &ARM64::getRelocAttrs(uint8_t type) const { static const std::array relocAttrsArray{{ #define B(x) RelocAttrBits::x - {"UNSIGNED", B(UNSIGNED) | B(ABSOLUTE) | B(EXTERN) | B(LOCAL) | - B(DYSYM8) | B(BYTE4) | B(BYTE8)}, + {"UNSIGNED", + B(UNSIGNED) | B(ABSOLUTE) | B(EXTERN) | B(LOCAL) | B(BYTE4) | B(BYTE8)}, {"SUBTRACTOR", B(SUBTRAHEND) | B(BYTE4) | B(BYTE8)}, {"BRANCH26", B(PCREL) | B(EXTERN) | B(BRANCH) | B(BYTE4)}, {"PAGE21", B(PCREL) | B(EXTERN) | B(BYTE4)}, diff --git a/lld/MachO/Arch/X86_64.cpp b/lld/MachO/Arch/X86_64.cpp --- a/lld/MachO/Arch/X86_64.cpp +++ b/lld/MachO/Arch/X86_64.cpp @@ -45,8 +45,8 @@ const RelocAttrs &X86_64::getRelocAttrs(uint8_t type) const { static const std::array relocAttrsArray{{ #define B(x) RelocAttrBits::x - {"UNSIGNED", B(UNSIGNED) | B(ABSOLUTE) | B(EXTERN) | B(LOCAL) | - B(DYSYM8) | B(BYTE4) | B(BYTE8)}, + {"UNSIGNED", + B(UNSIGNED) | B(ABSOLUTE) | B(EXTERN) | B(LOCAL) | B(BYTE4) | B(BYTE8)}, {"SIGNED", B(PCREL) | B(EXTERN) | B(LOCAL) | B(BYTE4)}, {"BRANCH", B(PCREL) | B(EXTERN) | B(BRANCH) | B(BYTE4)}, {"GOT_LOAD", B(PCREL) | B(EXTERN) | B(GOT) | B(LOAD) | B(BYTE4)}, diff --git a/lld/MachO/Relocations.h b/lld/MachO/Relocations.h --- a/lld/MachO/Relocations.h +++ b/lld/MachO/Relocations.h @@ -36,11 +36,10 @@ BRANCH = 1 << 8, // Value is branch target GOT = 1 << 9, // References a symbol in the Global Offset Table TLV = 1 << 10, // References a thread-local symbol - DYSYM8 = 1 << 11, // Requires DySym width to be 8 bytes - LOAD = 1 << 12, // Relaxable indirect load - POINTER = 1 << 13, // Non-relaxable indirect load (pointer is taken) - UNSIGNED = 1 << 14, // *_UNSIGNED relocs - LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue*/ (1 << 15) - 1), + LOAD = 1 << 11, // Relaxable indirect load + POINTER = 1 << 12, // Non-relaxable indirect load (pointer is taken) + UNSIGNED = 1 << 13, // *_UNSIGNED relocs + LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue*/ (1 << 14) - 1), }; // Note: SUBTRACTOR always pairs with UNSIGNED (a delta between two symbols). diff --git a/lld/MachO/Relocations.cpp b/lld/MachO/Relocations.cpp --- a/lld/MachO/Relocations.cpp +++ b/lld/MachO/Relocations.cpp @@ -31,10 +31,6 @@ if (relocAttrs.hasAttr(RelocAttrBits::TLV) != sym->isTlv()) error(message(Twine("requires that variable ") + (sym->isTlv() ? "not " : "") + "be thread-local")); - if (relocAttrs.hasAttr(RelocAttrBits::DYSYM8) && isa(sym) && - r.length != 3) - error(message("has width " + std::to_string(1 << r.length) + - " bytes, but must be 8 bytes")); return valid; }