[PATCH] D100133: [lld-macho] Remove DYSYM8 reloc attribute
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 8 12:22:23 PDT 2021
int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added a project: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
It's likely redundant, per discussion with @gkm. The BYTE8
attribute covers the bit width requirement already.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D100133
Files:
lld/MachO/Arch/ARM64.cpp
lld/MachO/Arch/X86_64.cpp
lld/MachO/Relocations.cpp
lld/MachO/Relocations.h
Index: lld/MachO/Relocations.h
===================================================================
--- lld/MachO/Relocations.h
+++ 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).
Index: lld/MachO/Relocations.cpp
===================================================================
--- lld/MachO/Relocations.cpp
+++ 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<DylibSymbol>(sym) &&
- r.length != 3)
- error(message("has width " + std::to_string(1 << r.length) +
- " bytes, but must be 8 bytes"));
return valid;
}
Index: lld/MachO/Arch/X86_64.cpp
===================================================================
--- lld/MachO/Arch/X86_64.cpp
+++ lld/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)},
Index: lld/MachO/Arch/ARM64.cpp
===================================================================
--- lld/MachO/Arch/ARM64.cpp
+++ lld/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)},
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100133.336194.patch
Type: text/x-patch
Size: 3079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210408/1860fadf/attachment.bin>
More information about the llvm-commits
mailing list