blob: 4125d4578b23ba092bc03a6f2de5bee16b3fcf27 [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);
Josh Poimboeuf1e7e4782020-08-18 15:57:45 +020021 struct list_head static_call_list;
Matt Helsleyd37c90d2020-05-19 13:55:32 -070022 bool ignore_unreachables, c_file, hints, rodata;
23};
24
Julien Thierry6545eb02020-08-25 13:47:39 +010025struct objtool_file *objtool_open_read(const char *_objname);
26
Julien Thierryd44becb2020-08-25 13:47:40 +010027int check(struct objtool_file *file);
Matt Helsley0decf1f2020-05-19 13:55:33 -070028int orc_dump(const char *objname);
29int create_orc(struct objtool_file *file);
30int create_orc_sections(struct objtool_file *file);
31
Matt Helsleyd37c90d2020-05-19 13:55:32 -070032#endif /* _OBJTOOL_H */