1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-13 09:39:13 +03:00

[ELF] Accept any argv[0] other than ld64 or ld64.mold

ld is often named as x86_64-pc-linux-gnu-ld or some other system-
dependent name. We shouldn't report an error for an unknown argv[0].
This commit is contained in:
Rui Ueyama 2021-11-20 13:03:12 +09:00
parent 72cea9a0bf
commit 411706d147

View File

@ -41,12 +41,8 @@ void install_signal_handler() {
int main(int argc, char **argv) {
std::string_view cmd = mold::path_filename(argv[0]);
if (cmd == "ld" || cmd == "mold" || cmd == "ld.mold")
return mold::elf::main(argc, argv);
if (cmd == "ld64" || cmd == "ld64.mold")
return mold::macho::main(argc, argv);
std::cerr << "mold: unknown command: " << argv[0] << "\n";
exit(1);
return mold::elf::main(argc, argv);
}