1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 02:44:48 +03:00

Add -V option

This commit is contained in:
Rui Ueyama 2021-05-10 16:53:14 +09:00
parent 18acebad2d
commit 6014faec2a
2 changed files with 10 additions and 0 deletions

View File

@ -365,6 +365,12 @@ void parse_nonpositional_args(Context<E> &ctx,
exit(0);
}
if (read_flag(args, "V")) {
SyncOut(ctx) << "mold " GIT_HASH " (compatible with GNU ld)\n"
<< " Supported emulations:\n elf_x86_64\n elf_i386";
exit(0);
}
if (read_flag(args, "help")) {
SyncOut(ctx) << "Usage: " << ctx.cmdline_args[0]
<< " [options] file...\n\n"

View File

@ -8,4 +8,8 @@ mkdir -p $t
../mold -v | grep -Pq 'mold .*\(compatible with GNU ld\)'
../mold --version | grep -Pq 'mold .*\(compatible with GNU ld\)'
../mold -V | grep -Pq 'mold .*\(compatible with GNU ld\)'
../mold -V | grep -q elf_x86_64
../mold -V | grep -q elf_i386
echo OK