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); |
Peter Zijlstra | 33092b4 | 2021-03-26 16:12:12 +0100 | [diff] [blame] | 21 | struct list_head retpoline_call_list; |
Peter Zijlstra | 8bdb25f | 2022-06-14 23:15:38 +0200 | [diff] [blame] | 22 | struct list_head return_thunk_list; |
Josh Poimboeuf | 1e7e478 | 2020-08-18 15:57:45 +0200 | [diff] [blame] | 23 | struct list_head static_call_list; |
Peter Zijlstra | 7dcfcd4 | 2020-08-06 15:14:09 -0700 | [diff] [blame] | 24 | struct list_head mcount_loc_list; |
Matt Helsley | d37c90d | 2020-05-19 13:55:32 -0700 | [diff] [blame] | 25 | bool ignore_unreachables, c_file, hints, rodata; |
| 26 | }; |
| 27 | |
Julien Thierry | 6545eb0 | 2020-08-25 13:47:39 +0100 | [diff] [blame] | 28 | struct objtool_file *objtool_open_read(const char *_objname); |
| 29 | |
Julien Thierry | d44becb | 2020-08-25 13:47:40 +0100 | [diff] [blame] | 30 | int check(struct objtool_file *file); |
Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 31 | int orc_dump(const char *objname); |
Josh Poimboeuf | 1d516bd | 2020-12-17 15:02:42 -0600 | [diff] [blame] | 32 | int orc_create(struct objtool_file *file); |
Matt Helsley | 0decf1f | 2020-05-19 13:55:33 -0700 | [diff] [blame] | 33 | |
Matt Helsley | d37c90d | 2020-05-19 13:55:32 -0700 | [diff] [blame] | 34 | #endif /* _OBJTOOL_H */ |