Index: lld/MachO/InputFiles.cpp =================================================================== --- lld/MachO/InputFiles.cpp +++ lld/MachO/InputFiles.cpp @@ -980,7 +980,7 @@ StringRef action; StringRef name; - std::tie(action, name) = originalName.drop_front(4 /* $ld$ */).split('$'); + std::tie(action, name) = originalName.drop_front(strlen("$ld$")).split('$'); if (action == "previous") handleLDPreviousSymbol(name, originalName); else if (action == "install_name") @@ -1047,8 +1047,7 @@ StringRef condition, installName; std::tie(condition, installName) = name.split('$'); VersionTuple version; - if (!condition.startswith("os") || - version.tryParse(condition.drop_front(2 /* os */))) { + if (!condition.consume_front("os") || version.tryParse(condition)) { warn("failed to parse os version, symbol '" + originalName + "' ignored"); return; }