--- /dev/null
+# RUN: llvm-objcopy -version | FileCheck %s
+# RUN: llvm-objcopy --version | FileCheck %s
+
+# CHECK: {{ version }}
--- /dev/null
+# RUN: llvm-strip -version | FileCheck %s
+# RUN: llvm-strip --version | FileCheck %s
+
+# CHECK: {{ version }}
"with '#'. Leading and trailing whitespace is stripped from each "
"line. May be repeated to read symbols from many files.">;
+def version : Flag<[ "-", "--" ], "version">,
+ HelpText<"Print the version and exit.">;
+
defm weaken_symbol : Eq<"weaken-symbol">,
MetaVarName<"symbol">,
HelpText<"Mark <symbol> as weak">;
def discard_all : Flag<["-", "--"], "discard-all">,
HelpText<"Remove all local symbols except file and section symbols">;
+
+def version : Flag<[ "-", "--" ], "version">,
+ HelpText<"Print the version and exit.">;
+
def x : Flag<["-"], "x">,
Alias<discard_all>;
exit(0);
}
+ if (InputArgs.hasArg(OBJCOPY_version)) {
+ cl::PrintVersionMessage();
+ exit(0);
+ }
+
SmallVector<const char *, 2> Positional;
for (auto Arg : InputArgs.filtered(OBJCOPY_UNKNOWN))
exit(0);
}
+ if (InputArgs.hasArg(STRIP_version)) {
+ cl::PrintVersionMessage();
+ exit(0);
+ }
+
SmallVector<const char *, 2> Positional;
for (auto Arg : InputArgs.filtered(STRIP_UNKNOWN))
error("unknown argument '" + Arg->getAsString(InputArgs) + "'");