1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2017 Josh Poimboeuf <jpoimboe@redhat.com>
9 * This command analyzes a .o file and adds .orc_unwind and .orc_unwind_ip
10 * sections to it, which is used by the in-kernel ORC unwinder.
12 * This command is a superset of "objtool check".
20 static const char *orc_usage
[] = {
21 "objtool orc generate [<options>] file.o",
22 "objtool orc dump file.o",
26 int cmd_orc(int argc
, const char **argv
)
32 usage_with_options(orc_usage
, check_options
);
34 if (!strncmp(argv
[0], "gen", 3)) {
35 argc
= parse_options(argc
, argv
, check_options
, orc_usage
, 0);
37 usage_with_options(orc_usage
, check_options
);
41 return check(objname
, true);
44 if (!strcmp(argv
[0], "dump")) {
46 usage_with_options(orc_usage
, check_options
);
50 return orc_dump(objname
);
53 usage_with_options(orc_usage
, check_options
);