xref: /haiku/headers/private/system/arch/x86_64/arch_elf.h (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1 /*
2  * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _KERNEL_ARCH_x86_64_ELF_H
6 #define _KERNEL_ARCH_x86_64_ELF_H
7 
8 
9 /* Relocation types. */
10 #define R_X86_64_NONE				0	/* No relocation. */
11 #define R_X86_64_64					1	/* Direct 64-bit. */
12 #define R_X86_64_PC32				2	/* PC relative 32-bit signed. */
13 #define R_X86_64_GOT32				3	/* 32-bit GOT entry. */
14 #define R_X86_64_PLT32				4	/* 32-bit PLT address. */
15 #define R_X86_64_COPY				5	/* Copy symbol at runtime. */
16 #define R_X86_64_GLOB_DAT			6	/* Create GOT entry. */
17 #define R_X86_64_JUMP_SLOT			7	/* Create PLT entry. */
18 #define R_X86_64_RELATIVE			8	/* Adjust by program base. */
19 #define R_X86_64_GOTPCREL			9	/* 32-bit signed PC relative offset to GOT. */
20 #define R_X86_64_32					10	/* Direct 32-bit zero-extended. */
21 #define R_X86_64_32S				11	/* Direct 32-bit sign-extended. */
22 #define R_X86_64_16					12	/* Direct 16-bit zero-extended. */
23 #define R_X86_64_PC16				13	/* 16-bit sign-extended PC relative. */
24 #define R_X86_64_8					14	/* Direct 8-bit sign-extended. */
25 #define R_X86_64_PC8				15	/* 8-bit sign-extended PC relative. */
26 #define R_X86_64_DTPMOD64			16	/* ID of module containing symbol. */
27 #define R_X86_64_DTPOFF64			17	/* Offset in module's TLS block. */
28 #define R_X86_64_TPOFF64			18	/* Offset in initial TLS block. */
29 #define R_X86_64_TLSGD				19	/* 32-bit signed PC relative offset to two GOT entries (GD). */
30 #define R_X86_64_TLSLD				20	/* 32-bit signed PC relative offset to two GOT entries (LD). */
31 #define R_X86_64_DTPOFF32			21	/* Offset in TLS block. */
32 #define R_X86_64_GOTTPOFF			22	/* 32-bit signed PC relative offset to GOT entry (IE). */
33 #define R_X86_64_TPOFF32			23	/* Offset in initial TLS block. */
34 #define R_X86_64_PC64				24	/* PC relative 64-bit. */
35 #define R_X86_64_GOTOFF64			25	/* 64-bit offset to GOT. */
36 #define R_X86_64_GOTPC32			26	/* 32 bit signed PC relative offset to GOT. */
37 #define R_X86_64_GOT64				27	/* 64-bit GOT entry offset. */
38 #define R_X86_64_GOTPCREL64			28	/* 64-bit PC relative offset to GOT entry. */
39 #define R_X86_64_GOTPC64			29	/* 64-bit PC relative offset to GOT. */
40 #define R_X86_64_GOTPLT64			30	/* Like GOT64, says PLT entry needed. */
41 #define R_X86_64_PLTOFF64			31	/* 64-bit GOT relative offset to PLT entry. */
42 #define R_X86_64_SIZE32				32	/* Size of symbol plus 32-bit addend. */
43 #define R_X86_64_SIZE64				33	/* Size of symbol plus 64-bit addend. */
44 #define R_X86_64_GOTPC32_TLSDESC	34	/* GOT offset for TLS descriptor. */
45 #define R_X86_64_TLSDESC_CALL		35	/* Marker for call through TLS descriptor. */
46 #define R_X86_64_TLSDESC			36	/* TLS descriptor. */
47 #define R_X86_64_IRELATIVE			37	/* Adjust indirectly by program base. */
48 #define R_X86_64_RELATIVE64			38	/* 64-bit adjust by program base */
49 /* 39 and 40 were BND-related, already decomissioned */
50 #define R_X86_64_GOTPCRELX			40	/* Load from 32 bit signed pc relative offset to GOT entry
51 										without REX prefix, relaxable. */
52 #define R_X86_64_REX_GOTPCRELX		41	/* Load from 32 bit signed pc relative offset to GOT entry
53 										with REX prefix, relaxable. */
54 
55 
56 #if defined(_BOOT_MODE) || defined(ELF32_COMPAT)
57 # include "../x86/arch_elf.h"
58 #endif
59 
60 
61 #endif	/* _KERNEL_ARCH_x86_64_ELF_H */
62