xref: /haiku/headers/private/system/arch/x86/arch_elf.h (revision 52f7c9389475e19fc21487b38064b4390eeb6fea)
1 /*
2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
5 #ifndef _KERNEL_ARCH_x86_ELF_H
6 #define _KERNEL_ARCH_x86_ELF_H
7 
8 /* relocation types */
9 
10 #define	R_386_NONE			0	/* No relocation. */
11 #define	R_386_32			1	/* Add symbol value. */
12 #define	R_386_PC32			2	/* Add PC-relative symbol value. */
13 #define	R_386_GOT32			3	/* Add PC-relative GOT offset. */
14 #define	R_386_PLT32			4	/* Add PC-relative PLT offset. */
15 #define	R_386_COPY			5	/* Copy data from shared object. */
16 #define	R_386_GLOB_DAT		6	/* Set GOT entry to data address. */
17 #define	R_386_JMP_SLOT		7	/* Set GOT entry to code address. */
18 #define	R_386_RELATIVE		8	/* Add load address of shared object. */
19 #define	R_386_GOTOFF		9	/* Add GOT-relative symbol address. */
20 #define	R_386_GOTPC			10	/* Add PC-relative GOT table address. */
21 #define	R_386_32PLT			11
22 #define	R_386_TLS_TPOFF		14	/* Negative offset in static TLS block */
23 #define	R_386_TLS_IE		15	/* Absolute address of GOT for -ve static TLS */
24 #define	R_386_TLS_GOTIE		16	/* GOT entry for negative static TLS block */
25 #define	R_386_TLS_LE		17	/* Negative offset relative to static TLS */
26 #define	R_386_TLS_GD		18	/* 32 bit offset to GOT (index,off) pair */
27 #define	R_386_TLS_LDM		19	/* 32 bit offset to GOT (index,zero) pair */
28 #define	R_386_16			20
29 #define	R_386_PC16			21
30 #define	R_386_8				22
31 #define	R_386_PC8			23
32 #define	R_386_TLS_GD_32		24	/* 32 bit offset to GOT (index,off) pair */
33 #define	R_386_TLS_GD_PUSH	25	/* pushl instruction for Sun ABI GD sequence */
34 #define	R_386_TLS_GD_CALL	26	/* call instruction for Sun ABI GD sequence */
35 #define	R_386_TLS_GD_POP	27	/* popl instruction for Sun ABI GD sequence */
36 #define	R_386_TLS_LDM_32	28	/* 32 bit offset to GOT (index,zero) pair */
37 #define	R_386_TLS_LDM_PUSH	29	/* pushl instruction for Sun ABI LD sequence */
38 #define	R_386_TLS_LDM_CALL	30	/* call instruction for Sun ABI LD sequence */
39 #define	R_386_TLS_LDM_POP	31	/* popl instruction for Sun ABI LD sequence */
40 #define	R_386_TLS_LDO_32	32	/* 32 bit offset from start of TLS block */
41 #define	R_386_TLS_IE_32		33	/* 32 bit offset to GOT static TLS offset entry */
42 #define	R_386_TLS_LE_32		34	/* 32 bit offset within static TLS block */
43 #define	R_386_TLS_DTPMOD32	35	/* GOT entry containing TLS index */
44 #define	R_386_TLS_DTPOFF32	36	/* GOT entry containing TLS offset */
45 #define	R_386_TLS_TPOFF32	37	/* GOT entry of -ve static TLS offset */
46 #define	R_386_SIZE32		38
47 #define	R_386_TLS_GOTDESC	39
48 #define	R_386_TLS_DESC_CALL	40
49 #define	R_386_TLS_DESC		41
50 #define	R_386_IRELATIVE		42	/* PLT entry resolved indirectly at runtime */
51 #define	R_386_GOT32X		43
52 
53 #define TLS_DTV_OFFSET 0
54 
55 #ifdef _BOOT_MODE
56 # include "../x86_64/arch_elf.h"
57 #endif
58 
59 #endif	/* _KERNEL_ARCH_x86_ELF_H */
60