diff --git a/lld/MachO/ConcatOutputSection.cpp b/lld/MachO/ConcatOutputSection.cpp --- a/lld/MachO/ConcatOutputSection.cpp +++ b/lld/MachO/ConcatOutputSection.cpp @@ -339,8 +339,8 @@ // are actually merged. The logic presented here was written without // any form of informed research. void ConcatOutputSection::mergeFlags(InputSection *input) { - uint8_t baseType = flags & SECTION_TYPE; - uint8_t inputType = input->flags & SECTION_TYPE; + uint8_t baseType = sectionType(flags); + uint8_t inputType = sectionType(input->flags); if (baseType != inputType) error("Cannot merge section " + input->name + " (type=0x" + to_hexString(inputType) + ") into " + name + " (type=0x" + diff --git a/lld/MachO/InputSection.cpp b/lld/MachO/InputSection.cpp --- a/lld/MachO/InputSection.cpp +++ b/lld/MachO/InputSection.cpp @@ -128,7 +128,7 @@ } bool macho::isCodeSection(const InputSection *isec) { - uint32_t type = isec->flags & SECTION_TYPE; + uint32_t type = sectionType(isec->flags); if (type != S_REGULAR && type != S_COALESCED) return false;