diff --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp --- a/lld/MachO/Writer.cpp +++ b/lld/MachO/Writer.cpp @@ -495,7 +495,7 @@ c->ntools = ntools; auto *t = reinterpret_cast(&c[1]); - t->tool = TOOL_LD; + t->tool = TOOL_LLD; t->version = encodeVersion(VersionTuple( LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR, LLVM_VERSION_PATCH)); } diff --git a/lld/test/MachO/lc-build-version.s b/lld/test/MachO/lc-build-version.s --- a/lld/test/MachO/lc-build-version.s +++ b/lld/test/MachO/lc-build-version.s @@ -11,7 +11,7 @@ # MACOS-10-14-NEXT: sdk 10.15 # MACOS-10-14-NEXT: minos 10.14 # MACOS-10-14-NEXT: ntools 1 -# MACOS-10-14-NEXT: tool ld +# MACOS-10-14-NEXT: tool lld # MACOS-10-14-NEXT: version {{[0-9\.]+}} # RUN: %lld -platform_version macos 10.13 10.15 -o %t.macos-10-13 %t.o diff --git a/llvm/include/llvm/BinaryFormat/MachO.h b/llvm/include/llvm/BinaryFormat/MachO.h --- a/llvm/include/llvm/BinaryFormat/MachO.h +++ b/llvm/include/llvm/BinaryFormat/MachO.h @@ -511,7 +511,7 @@ }; // Values for tools enum in build_tool_version. -enum { TOOL_CLANG = 1, TOOL_SWIFT = 2, TOOL_LD = 3 }; +enum { TOOL_CLANG = 1, TOOL_SWIFT = 2, TOOL_LD = 3, TOOL_LLD = 4 }; // Structs from diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h --- a/llvm/include/llvm/Object/MachO.h +++ b/llvm/include/llvm/Object/MachO.h @@ -807,6 +807,8 @@ case MachO::TOOL_CLANG: return "clang"; case MachO::TOOL_SWIFT: return "swift"; case MachO::TOOL_LD: return "ld"; + case MachO::TOOL_LLD: + return "lld"; default: std::string ret; raw_string_ostream ss(ret);