18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2020 Matt Helsley <mhelsley@vmware.com>
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef _OBJTOOL_H
78c2ecf20Sopenharmony_ci#define _OBJTOOL_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <stdbool.h>
108c2ecf20Sopenharmony_ci#include <linux/list.h>
118c2ecf20Sopenharmony_ci#include <linux/hashtable.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include "elf.h"
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#define __weak __attribute__((weak))
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_cistruct objtool_file {
188c2ecf20Sopenharmony_ci	struct elf *elf;
198c2ecf20Sopenharmony_ci	struct list_head insn_list;
208c2ecf20Sopenharmony_ci	DECLARE_HASHTABLE(insn_hash, 20);
218c2ecf20Sopenharmony_ci	struct list_head retpoline_call_list;
228c2ecf20Sopenharmony_ci	struct list_head return_thunk_list;
238c2ecf20Sopenharmony_ci	struct list_head static_call_list;
248c2ecf20Sopenharmony_ci	bool ignore_unreachables, c_file, hints, rodata;
258c2ecf20Sopenharmony_ci};
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cistruct objtool_file *objtool_open_read(const char *_objname);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciint check(struct objtool_file *file);
308c2ecf20Sopenharmony_ciint orc_dump(const char *objname);
318c2ecf20Sopenharmony_ciint orc_create(struct objtool_file *file);
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#endif /* _OBJTOOL_H */
34