blob: efd1a66158e79ab80be8d0fc7197793d4ac2a7bd [file] [log] [blame]
Matt Helsleyd37c90d2020-05-19 13:55:32 -07001/* 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 Thierryeda3dc92020-09-04 16:30:22 +010015#define __weak __attribute__((weak))
16
Matt Helsleyd37c90d2020-05-19 13:55:32 -070017struct objtool_file {
18 struct elf *elf;
19 struct list_head insn_list;
20 DECLARE_HASHTABLE(insn_hash, 20);
Peter Zijlstra33092b42021-03-26 16:12:12 +010021 struct list_head retpoline_call_list;
Peter Zijlstra8bdb25f2022-06-14 23:15:38 +020022 struct list_head return_thunk_list;
Josh Poimboeuf1e7e4782020-08-18 15:57:45 +020023 struct list_head static_call_list;
Peter Zijlstra7dcfcd42020-08-06 15:14:09 -070024 struct list_head mcount_loc_list;
Matt Helsleyd37c90d2020-05-19 13:55:32 -070025 bool ignore_unreachables, c_file, hints, rodata;
26};
27
Julien Thierry6545eb02020-08-25 13:47:39 +010028struct objtool_file *objtool_open_read(const char *_objname);
29
Julien Thierryd44becb2020-08-25 13:47:40 +010030int check(struct objtool_file *file);
Matt Helsley0decf1f2020-05-19 13:55:33 -070031int orc_dump(const char *objname);
Josh Poimboeuf1d516bd2020-12-17 15:02:42 -060032int orc_create(struct objtool_file *file);
Matt Helsley0decf1f2020-05-19 13:55:33 -070033
Matt Helsleyd37c90d2020-05-19 13:55:32 -070034#endif /* _OBJTOOL_H */