aboutsummaryrefslogtreecommitdiff
path: root/lld/MachO/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/MachO/InputFiles.cpp')
-rw-r--r--lld/MachO/InputFiles.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index 442fc60..20e4a1d 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -516,12 +516,8 @@ static bool validateRelocationInfo(InputFile *file, const SectionHeader &sec,
if (isThreadLocalVariables(sec.flags) &&
!relocAttrs.hasAttr(RelocAttrBits::UNSIGNED))
error(message("not allowed in thread-local section, must be UNSIGNED"));
- if (rel.r_length < 2 || rel.r_length > 3 ||
- !relocAttrs.hasAttr(static_cast<RelocAttrBits>(1 << rel.r_length))) {
- static SmallVector<StringRef, 4> widths{"0", "4", "8", "4 or 8"};
- error(message("has width " + std::to_string(1 << rel.r_length) +
- " bytes, but must be " +
- widths[(static_cast<int>(relocAttrs.bits) >> 2) & 3] +
+ if (!relocAttrs.hasAttr(static_cast<RelocAttrBits>(1 << rel.r_length))) {
+ error(message("has invalid width of " + std::to_string(1 << rel.r_length) +
" bytes"));
}
return valid;