diff --git a/lld/MachO/ConcatOutputSection.cpp b/lld/MachO/ConcatOutputSection.cpp --- a/lld/MachO/ConcatOutputSection.cpp +++ b/lld/MachO/ConcatOutputSection.cpp @@ -348,7 +348,7 @@ constexpr uint32_t strictFlags = S_ATTR_DEBUG | S_ATTR_STRIP_STATIC_SYMS | S_ATTR_NO_DEAD_STRIP | S_ATTR_LIVE_SUPPORT; - if ((input->flags ^ flags) & strictFlags) + if (input->flags && ((input->flags ^ flags) & strictFlags)) error("Cannot merge section " + input->name + " (flags=0x" + to_hexString(input->flags) + ") into " + name + " (flags=0x" + to_hexString(flags) + "): strict flags differ");