xref: /minix3/sys/arch/i386/include/elf_machdep.h (revision f6aac1c3b5ca21b829888677e8ee6bc9cda07e52)
1*f6aac1c3SLionel Sambuc /*	$NetBSD: elf_machdep.h,v 1.10 2009/05/30 05:56:52 skrll Exp $	*/
2*f6aac1c3SLionel Sambuc 
3*f6aac1c3SLionel Sambuc #define	ELF32_MACHDEP_ENDIANNESS	ELFDATA2LSB
4*f6aac1c3SLionel Sambuc #define	ELF32_MACHDEP_ID_CASES						\
5*f6aac1c3SLionel Sambuc 		case EM_386:						\
6*f6aac1c3SLionel Sambuc 		case EM_486:						\
7*f6aac1c3SLionel Sambuc 			break;
8*f6aac1c3SLionel Sambuc 
9*f6aac1c3SLionel Sambuc #define	ELF64_MACHDEP_ENDIANNESS	XXX	/* break compilation */
10*f6aac1c3SLionel Sambuc #define	ELF64_MACHDEP_ID_CASES						\
11*f6aac1c3SLionel Sambuc 		/* no 64-bit ELF machine types supported */
12*f6aac1c3SLionel Sambuc 
13*f6aac1c3SLionel Sambuc #define	ELF32_MACHDEP_ID		EM_386
14*f6aac1c3SLionel Sambuc 
15*f6aac1c3SLionel Sambuc #define ARCH_ELFSIZE		32	/* MD native binary size */
16*f6aac1c3SLionel Sambuc 
17*f6aac1c3SLionel Sambuc /* i386 relocations */
18*f6aac1c3SLionel Sambuc #define	R_386_NONE	0
19*f6aac1c3SLionel Sambuc #define	R_386_32	1
20*f6aac1c3SLionel Sambuc #define	R_386_PC32	2
21*f6aac1c3SLionel Sambuc #define	R_386_GOT32	3
22*f6aac1c3SLionel Sambuc #define	R_386_PLT32	4
23*f6aac1c3SLionel Sambuc #define	R_386_COPY	5
24*f6aac1c3SLionel Sambuc #define	R_386_GLOB_DAT	6
25*f6aac1c3SLionel Sambuc #define	R_386_JMP_SLOT	7
26*f6aac1c3SLionel Sambuc #define	R_386_RELATIVE	8
27*f6aac1c3SLionel Sambuc #define	R_386_GOTOFF	9
28*f6aac1c3SLionel Sambuc #define	R_386_GOTPC	10
29*f6aac1c3SLionel Sambuc 
30*f6aac1c3SLionel Sambuc /* TLS relocations */
31*f6aac1c3SLionel Sambuc #define	R_386_TLS_TPOFF	14
32*f6aac1c3SLionel Sambuc #define	R_386_TLS_IE	15
33*f6aac1c3SLionel Sambuc #define	R_386_TLS_GOTIE	16
34*f6aac1c3SLionel Sambuc #define	R_386_TLS_LE	17
35*f6aac1c3SLionel Sambuc #define	R_386_TLS_GD	18
36*f6aac1c3SLionel Sambuc #define	R_386_TLS_LDM	19
37*f6aac1c3SLionel Sambuc 
38*f6aac1c3SLionel Sambuc /* The following relocations are GNU extensions. */
39*f6aac1c3SLionel Sambuc #define	R_386_16	20
40*f6aac1c3SLionel Sambuc #define	R_386_PC16	21
41*f6aac1c3SLionel Sambuc #define	R_386_8		22
42*f6aac1c3SLionel Sambuc #define	R_386_PC8	23
43*f6aac1c3SLionel Sambuc 
44*f6aac1c3SLionel Sambuc /* More TLS relocations */
45*f6aac1c3SLionel Sambuc #define	R_386_TLS_GD_32		24
46*f6aac1c3SLionel Sambuc #define	R_386_TLS_GD_PUSH	25
47*f6aac1c3SLionel Sambuc #define	R_386_TLS_GD_CALL	26
48*f6aac1c3SLionel Sambuc #define	R_386_TLS_GD_POP	27
49*f6aac1c3SLionel Sambuc #define	R_386_TLS_LDM_32	28
50*f6aac1c3SLionel Sambuc #define	R_386_TLS_LDM_PUSH	29
51*f6aac1c3SLionel Sambuc #define	R_386_TLS_LDM_CALL	30
52*f6aac1c3SLionel Sambuc #define	R_386_TLS_LDM_POP	31
53*f6aac1c3SLionel Sambuc #define	R_386_TLS_LDO_32	32
54*f6aac1c3SLionel Sambuc #define	R_386_TLS_IE_32		33
55*f6aac1c3SLionel Sambuc #define	R_386_TLS_LE_32		34
56*f6aac1c3SLionel Sambuc #define	R_386_TLS_DTPMOD32	35
57*f6aac1c3SLionel Sambuc #define	R_386_TLS_DTPOFF32	36
58*f6aac1c3SLionel Sambuc #define	R_386_TLS_TPOFF32	37
59*f6aac1c3SLionel Sambuc #define	R_386_TLS_GOTDESC	39
60*f6aac1c3SLionel Sambuc #define	R_386_TLS_DESC_CALL	40
61*f6aac1c3SLionel Sambuc #define	R_386_TLS_DESC		41
62*f6aac1c3SLionel Sambuc 
63*f6aac1c3SLionel Sambuc #define	R_TYPE(name)	__CONCAT(R_386_,name)
64