[lld-macho][nfc] Remove DYSYM8 reloc attribute
It's likely redundant, per discussion with @gkm. The BYTE8
attribute covers the bit width requirement already.
Reviewed By: #lld-macho, gkm
Differential Revision: https://reviews.llvm.org/D100133
GitOrigin-RevId: 88cb786ec261c9d947b3116c00ecd30e6570f64c
diff --git a/MachO/Arch/ARM64.cpp b/MachO/Arch/ARM64.cpp
index bbb426a..f0d0b30 100644
--- a/MachO/Arch/ARM64.cpp
+++ b/MachO/Arch/ARM64.cpp
@@ -55,8 +55,8 @@
const RelocAttrs &ARM64::getRelocAttrs(uint8_t type) const {
static const std::array<RelocAttrs, 11> 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/MachO/Arch/X86_64.cpp b/MachO/Arch/X86_64.cpp
index 2e1120d..0feb7bb 100644
--- a/MachO/Arch/X86_64.cpp
+++ b/MachO/Arch/X86_64.cpp
@@ -45,8 +45,8 @@
const RelocAttrs &X86_64::getRelocAttrs(uint8_t type) const {
static const std::array<RelocAttrs, 10> 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/MachO/Relocations.cpp b/MachO/Relocations.cpp
index e3b4cea..03cb697 100644
--- a/MachO/Relocations.cpp
+++ b/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<DylibSymbol>(sym) &&
- r.length != 3)
- error(message("has width " + std::to_string(1 << r.length) +
- " bytes, but must be 8 bytes"));
return valid;
}
diff --git a/MachO/Relocations.h b/MachO/Relocations.h
index d58f9d4..6d31d27 100644
--- a/MachO/Relocations.h
+++ b/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).