blob: cf004dd60c2ba75a59a624bd211ebf9410711b96 [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;
Peter Zijlstra7dcfcd42020-08-06 15:14:09 -070022 struct list_head mcount_loc_list;
Matt Helsleyd37c90d2020-05-19 13:55:32 -070023 bool ignore_unreachables, c_file, hints, rodata;
24};
25
Julien Thierry6545eb02020-08-25 13:47:39 +010026struct objtool_file *objtool_open_read(const char *_objname);
27
Julien Thierryd44becb2020-08-25 13:47:40 +010028int check(struct objtool_file *file);
Matt Helsley0decf1f2020-05-19 13:55:33 -070029int orc_dump(const char *objname);
30int create_orc(struct objtool_file *file);
31int create_orc_sections(struct objtool_file *file);
32
Matt Helsleyd37c90d2020-05-19 13:55:32 -070033#endif /* _OBJTOOL_H */