xtensa: support DMA buffers in high memory
[cris-mirror.git] / tools / objtool / builtin-orc.c
blob91e8e19ff5e06193adc55c455b4d97ad947da7ee
1 /*
2 * Copyright (C) 2017 Josh Poimboeuf <jpoimboe@redhat.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19 * objtool orc:
21 * This command analyzes a .o file and adds .orc_unwind and .orc_unwind_ip
22 * sections to it, which is used by the in-kernel ORC unwinder.
24 * This command is a superset of "objtool check".
27 #include <string.h>
28 #include <subcmd/parse-options.h>
29 #include "builtin.h"
30 #include "check.h"
33 static const char *orc_usage[] = {
34 "objtool orc generate [<options>] file.o",
35 "objtool orc dump file.o",
36 NULL,
39 extern const struct option check_options[];
40 extern bool no_fp, no_unreachable;
42 int cmd_orc(int argc, const char **argv)
44 const char *objname;
46 argc--; argv++;
47 if (argc <= 0)
48 usage_with_options(orc_usage, check_options);
50 if (!strncmp(argv[0], "gen", 3)) {
51 argc = parse_options(argc, argv, check_options, orc_usage, 0);
52 if (argc != 1)
53 usage_with_options(orc_usage, check_options);
55 objname = argv[0];
57 return check(objname, no_fp, no_unreachable, true);
60 if (!strcmp(argv[0], "dump")) {
61 if (argc != 2)
62 usage_with_options(orc_usage, check_options);
64 objname = argv[1];
66 return orc_dump(objname);
69 usage_with_options(orc_usage, check_options);
71 return 0;