blob: bf64946e749bc37db831425275faa31024f553d1 [file] [log] [blame]
Olivier Deprez157378f2022-04-04 15:47:50 +02001/* 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
15#define __weak __attribute__((weak))
16
17struct objtool_file {
18 struct elf *elf;
19 struct list_head insn_list;
20 DECLARE_HASHTABLE(insn_hash, 20);
Olivier Deprez92d4c212022-12-06 15:05:30 +010021 struct list_head retpoline_call_list;
22 struct list_head return_thunk_list;
Olivier Deprez157378f2022-04-04 15:47:50 +020023 struct list_head static_call_list;
24 bool ignore_unreachables, c_file, hints, rodata;
25};
26
27struct objtool_file *objtool_open_read(const char *_objname);
28
29int check(struct objtool_file *file);
30int orc_dump(const char *objname);
Olivier Deprez92d4c212022-12-06 15:05:30 +010031int orc_create(struct objtool_file *file);
Olivier Deprez157378f2022-04-04 15:47:50 +020032
33#endif /* _OBJTOOL_H */