diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2013-04-16 16:02:58 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-04-16 16:02:58 -0700 |
commit | c889ba801dc3b3a0155fa77d567f2c3a6097de1c (patch) | |
tree | 257878e1eb565fc9765dd8fed20815f7781d116a /arch/x86/tools/relocs.h | |
parent | 17c961f7702ff6037b66bb2e5f3ddd58de4ce7e5 (diff) | |
download | op-kernel-dev-c889ba801dc3b3a0155fa77d567f2c3a6097de1c.zip op-kernel-dev-c889ba801dc3b3a0155fa77d567f2c3a6097de1c.tar.gz |
x86, relocs: Refactor the relocs tool to merge 32- and 64-bit ELF
Refactor the relocs tool so that the same tool can handle 32- and
64-bit ELF.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Kees Cook <keescook@chromium.org>
Link: http://lkml.kernel.org/r/1365797627-20874-5-git-send-email-keescook@chromium.org
Diffstat (limited to 'arch/x86/tools/relocs.h')
-rw-r--r-- | arch/x86/tools/relocs.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/x86/tools/relocs.h b/arch/x86/tools/relocs.h new file mode 100644 index 0000000..07cdb1e --- /dev/null +++ b/arch/x86/tools/relocs.h @@ -0,0 +1,36 @@ +#ifndef RELOCS_H +#define RELOCS_H + +#include <stdio.h> +#include <stdarg.h> +#include <stdlib.h> +#include <stdint.h> +#include <inttypes.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <elf.h> +#include <byteswap.h> +#define USE_BSD +#include <endian.h> +#include <regex.h> +#include <tools/le_byteshift.h> + +void die(char *fmt, ...); + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +enum symtype { + S_ABS, + S_REL, + S_SEG, + S_LIN, + S_NSYMTYPES +}; + +void process_32(FILE *fp, int use_real_mode, int as_text, + int show_absolute_syms, int show_absolute_relocs); +void process_64(FILE *fp, int use_real_mode, int as_text, + int show_absolute_syms, int show_absolute_relocs); + +#endif /* RELOCS_H */ |