xref: /kernel/linux/linux-5.10/arch/x86/tools/relocs.h (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef RELOCS_H
38c2ecf20Sopenharmony_ci#define RELOCS_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <stdio.h>
68c2ecf20Sopenharmony_ci#include <stdarg.h>
78c2ecf20Sopenharmony_ci#include <stdlib.h>
88c2ecf20Sopenharmony_ci#include <stdint.h>
98c2ecf20Sopenharmony_ci#include <inttypes.h>
108c2ecf20Sopenharmony_ci#include <string.h>
118c2ecf20Sopenharmony_ci#include <errno.h>
128c2ecf20Sopenharmony_ci#include <unistd.h>
138c2ecf20Sopenharmony_ci#include <elf.h>
148c2ecf20Sopenharmony_ci#include <byteswap.h>
158c2ecf20Sopenharmony_ci#define USE_BSD
168c2ecf20Sopenharmony_ci#include <endian.h>
178c2ecf20Sopenharmony_ci#include <regex.h>
188c2ecf20Sopenharmony_ci#include <tools/le_byteshift.h>
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_civoid die(char *fmt, ...) __attribute__((noreturn));
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cienum symtype {
258c2ecf20Sopenharmony_ci	S_ABS,
268c2ecf20Sopenharmony_ci	S_REL,
278c2ecf20Sopenharmony_ci	S_SEG,
288c2ecf20Sopenharmony_ci	S_LIN,
298c2ecf20Sopenharmony_ci	S_NSYMTYPES
308c2ecf20Sopenharmony_ci};
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_civoid process_32(FILE *fp, int use_real_mode, int as_text,
338c2ecf20Sopenharmony_ci		int show_absolute_syms, int show_absolute_relocs,
348c2ecf20Sopenharmony_ci		int show_reloc_info);
358c2ecf20Sopenharmony_civoid process_64(FILE *fp, int use_real_mode, int as_text,
368c2ecf20Sopenharmony_ci		int show_absolute_syms, int show_absolute_relocs,
378c2ecf20Sopenharmony_ci		int show_reloc_info);
388c2ecf20Sopenharmony_ci#endif /* RELOCS_H */
39