/*
 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
 * Distributed under the terms of the MIT License.
 */
#ifndef _KERNEL_ARCH_x86_64_ELF_H
#define _KERNEL_ARCH_x86_64_ELF_H


/* Relocation types. */
#define R_X86_64_NONE				0	/* No relocation. */
#define R_X86_64_64					1	/* Direct 64-bit. */
#define R_X86_64_PC32				2	/* PC relative 32-bit signed. */
#define R_X86_64_GOT32				3	/* 32-bit GOT entry. */
#define R_X86_64_PLT32				4	/* 32-bit PLT address. */
#define R_X86_64_COPY				5	/* Copy symbol at runtime. */
#define R_X86_64_GLOB_DAT			6	/* Create GOT entry. */
#define R_X86_64_JUMP_SLOT			7	/* Create PLT entry. */
#define R_X86_64_RELATIVE			8	/* Adjust by program base. */
#define R_X86_64_GOTPCREL			9	/* 32-bit signed PC relative offset to GOT. */
#define R_X86_64_32					10	/* Direct 32-bit zero-extended. */
#define R_X86_64_32S				11	/* Direct 32-bit sign-extended. */
#define R_X86_64_16					12	/* Direct 16-bit zero-extended. */
#define R_X86_64_PC16				13	/* 16-bit sign-extended PC relative. */
#define R_X86_64_8					14	/* Direct 8-bit sign-extended. */
#define R_X86_64_PC8				15	/* 8-bit sign-extended PC relative. */
#define R_X86_64_DTPMOD64			16	/* ID of module containing symbol. */
#define R_X86_64_DTPOFF64			17	/* Offset in module's TLS block. */
#define R_X86_64_TPOFF64			18	/* Offset in initial TLS block. */
#define R_X86_64_TLSGD				19	/* 32-bit signed PC relative offset to two GOT entries (GD). */
#define R_X86_64_TLSLD				20	/* 32-bit signed PC relative offset to two GOT entries (LD). */
#define R_X86_64_DTPOFF32			21	/* Offset in TLS block. */
#define R_X86_64_GOTTPOFF			22	/* 32-bit signed PC relative offset to GOT entry (IE). */
#define R_X86_64_TPOFF32			23	/* Offset in initial TLS block. */
#define R_X86_64_PC64				24	/* PC relative 64-bit. */
#define R_X86_64_GOTOFF64			25	/* 64-bit offset to GOT. */
#define R_X86_64_GOTPC32			26	/* 32 bit signed PC relative offset to GOT. */
#define R_X86_64_GOT64				27	/* 64-bit GOT entry offset. */
#define R_X86_64_GOTPCREL64			28	/* 64-bit PC relative offset to GOT entry. */
#define R_X86_64_GOTPC64			29	/* 64-bit PC relative offset to GOT. */
#define R_X86_64_GOTPLT64			30	/* Like GOT64, says PLT entry needed. */
#define R_X86_64_PLTOFF64			31	/* 64-bit GOT relative offset to PLT entry. */
#define R_X86_64_SIZE32				32	/* Size of symbol plus 32-bit addend. */
#define R_X86_64_SIZE64				33	/* Size of symbol plus 64-bit addend. */
#define R_X86_64_GOTPC32_TLSDESC	34	/* GOT offset for TLS descriptor. */
#define R_X86_64_TLSDESC_CALL		35	/* Marker for call through TLS descriptor. */
#define R_X86_64_TLSDESC			36	/* TLS descriptor. */
#define R_X86_64_IRELATIVE			37	/* Adjust indirectly by program base. */


#if defined(_BOOT_MODE) || defined(ELF32_COMPAT)
# include "../x86/arch_elf.h"
#endif


#endif	/* _KERNEL_ARCH_x86_64_ELF_H */
