Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | /* |
| 3 | * Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com> |
| 4 | * Weak definitions necessary to compile objtool without |
| 5 | * some subcommands (e.g. check, orc). |
| 6 | */ |
| 7 | |
| 8 | #include <stdbool.h> |
| 9 | #include <errno.h> |
Vasily Gorbik | 7786032 | 2020-11-13 00:03:32 +0100 | [diff] [blame] | 10 | #include <objtool/objtool.h> |
Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 11 | |
Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 12 | #define UNSUPPORTED(name) \ |
| 13 | ({ \ |
| 14 | fprintf(stderr, "error: objtool: " name " not implemented\n"); \ |
| 15 | return ENOSYS; \ |
| 16 | }) |
| 17 | |
Julien Thierry | d44becb | 2020-08-25 13:47:40 +0100 | [diff] [blame] | 18 | int __weak check(struct objtool_file *file) |
Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 19 | { |
| 20 | UNSUPPORTED("check subcommand"); |
| 21 | } |
| 22 | |
| 23 | int __weak orc_dump(const char *_objname) |
| 24 | { |
| 25 | UNSUPPORTED("orc"); |
| 26 | } |
| 27 | |
Josh Poimboeuf | ab4e074 | 2020-12-17 15:02:42 -0600 | [diff] [blame] | 28 | int __weak orc_create(struct objtool_file *file) |
Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 29 | { |
| 30 | UNSUPPORTED("orc"); |
| 31 | } |