Matt Helsley | d37c90d | 2020-05-19 13:55:32 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | /* |
| 3 | * Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com> |
| 4 | */ |
| 5 | |
| 6 | #ifndef _OBJTOOL_H |
| 7 | #define _OBJTOOL_H |
| 8 | |
| 9 | #include <stdbool.h> |
| 10 | #include <linux/list.h> |
| 11 | #include <linux/hashtable.h> |
| 12 | |
| 13 | #include "elf.h" |
| 14 | |
Julien Thierry | eda3dc9 | 2020-09-04 16:30:22 +0100 | [diff] [blame] | 15 | #define __weak __attribute__((weak)) |
| 16 | |
Matt Helsley | d37c90d | 2020-05-19 13:55:32 -0700 | [diff] [blame] | 17 | struct objtool_file { |
| 18 | struct elf *elf; |
| 19 | struct list_head insn_list; |
| 20 | DECLARE_HASHTABLE(insn_hash, 20); |
Josh Poimboeuf | 1e7e478 | 2020-08-18 15:57:45 +0200 | [diff] [blame] | 21 | struct list_head static_call_list; |
Matt Helsley | d37c90d | 2020-05-19 13:55:32 -0700 | [diff] [blame] | 22 | bool ignore_unreachables, c_file, hints, rodata; |
| 23 | }; |
| 24 | |
Julien Thierry | 6545eb0 | 2020-08-25 13:47:39 +0100 | [diff] [blame] | 25 | struct objtool_file *objtool_open_read(const char *_objname); |
| 26 | |
Julien Thierry | d44becb | 2020-08-25 13:47:40 +0100 | [diff] [blame] | 27 | int check(struct objtool_file *file); |
Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 28 | int orc_dump(const char *objname); |
| 29 | int create_orc(struct objtool_file *file); |
| 30 | int create_orc_sections(struct objtool_file *file); |
| 31 | |
Matt Helsley | d37c90d | 2020-05-19 13:55:32 -0700 | [diff] [blame] | 32 | #endif /* _OBJTOOL_H */ |