162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef RELOCS_H
362306a36Sopenharmony_ci#define RELOCS_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <stdio.h>
662306a36Sopenharmony_ci#include <stdarg.h>
762306a36Sopenharmony_ci#include <stdlib.h>
862306a36Sopenharmony_ci#include <stdint.h>
962306a36Sopenharmony_ci#include <inttypes.h>
1062306a36Sopenharmony_ci#include <string.h>
1162306a36Sopenharmony_ci#include <errno.h>
1262306a36Sopenharmony_ci#include <unistd.h>
1362306a36Sopenharmony_ci#include <elf.h>
1462306a36Sopenharmony_ci#include <byteswap.h>
1562306a36Sopenharmony_ci#define USE_BSD
1662306a36Sopenharmony_ci#include <endian.h>
1762306a36Sopenharmony_ci#include <regex.h>
1862306a36Sopenharmony_ci#include <tools/le_byteshift.h>
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci__attribute__((__format__(printf, 1, 2)))
2162306a36Sopenharmony_civoid die(char *fmt, ...) __attribute__((noreturn));
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_cienum symtype {
2662306a36Sopenharmony_ci	S_ABS,
2762306a36Sopenharmony_ci	S_REL,
2862306a36Sopenharmony_ci	S_SEG,
2962306a36Sopenharmony_ci	S_LIN,
3062306a36Sopenharmony_ci	S_NSYMTYPES
3162306a36Sopenharmony_ci};
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_civoid process_32(FILE *fp, int use_real_mode, int as_text,
3462306a36Sopenharmony_ci		int show_absolute_syms, int show_absolute_relocs,
3562306a36Sopenharmony_ci		int show_reloc_info);
3662306a36Sopenharmony_civoid process_64(FILE *fp, int use_real_mode, int as_text,
3762306a36Sopenharmony_ci		int show_absolute_syms, int show_absolute_relocs,
3862306a36Sopenharmony_ci		int show_reloc_info);
3962306a36Sopenharmony_ci#endif /* RELOCS_H */
40