xref: /illumos-gate/usr/src/uts/common/sys/elf_amd64.h (revision 43d18f1c320355e93c47399bea0b2e022fe06364)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_ELF_AMD64_H
28 #define	_SYS_ELF_AMD64_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	R_AMD64_NONE		0	/* relocation types */
37 #define	R_AMD64_64		1
38 #define	R_AMD64_PC32		2
39 #define	R_AMD64_GOT32		3
40 #define	R_AMD64_PLT32		4
41 #define	R_AMD64_COPY		5
42 #define	R_AMD64_GLOB_DAT	6
43 #define	R_AMD64_JUMP_SLOT	7
44 #define	R_AMD64_RELATIVE	8
45 #define	R_AMD64_GOTPCREL	9
46 #define	R_AMD64_32		10
47 #define	R_AMD64_32S		11
48 #define	R_AMD64_16		12
49 #define	R_AMD64_PC16		13
50 #define	R_AMD64_8		14
51 #define	R_AMD64_PC8		15
52 #define	R_AMD64_DTPMOD64	16
53 #define	R_AMD64_DTPOFF64	17
54 #define	R_AMD64_TPOFF64		18
55 #define	R_AMD64_TLSGD		19
56 #define	R_AMD64_TLSLD		20
57 #define	R_AMD64_DTPOFF32	21
58 #define	R_AMD64_GOTTPOFF	22
59 #define	R_AMD64_TPOFF32		23
60 #define	R_AMD64_PC64		24
61 #define	R_AMD64_GOTOFF64	25
62 #define	R_AMD64_GOTPC32		26
63 #define	R_AMD64_NUM		27
64 
65 
66 /*
67  * X86_64 compatibilty fields - these are obsolete, the prefered
68  * field naming are the _AMD64_ fields over the X86_64 names.
69  */
70 #define	R_X86_64_NONE		R_AMD64_NONE
71 #define	R_X86_64_64		R_AMD64_64
72 #define	R_X86_64_PC32		R_AMD64_PC32
73 #define	R_X86_64_GOT32		R_AMD64_GOT32
74 #define	R_X86_64_PLT32		R_AMD64_PLT32
75 #define	R_X86_64_COPY		R_AMD64_COPY
76 #define	R_X86_64_GLOB_DAT	R_AMD64_GLOB_DAT
77 #define	R_X86_64_JUMP_SLOT	R_AMD64_JUMP_SLOT
78 #define	R_X86_64_RELATIVE	R_AMD64_RELATIVE
79 #define	R_X86_64_GOTPCREL	R_AMD64_GOTPCREL
80 #define	R_X86_64_32		R_AMD64_32
81 #define	R_X86_64_32S		R_AMD64_32S
82 #define	R_X86_64_16		R_AMD64_16
83 #define	R_X86_64_PC16		R_AMD64_PC16
84 #define	R_X86_64_8		R_AMD64_8
85 #define	R_X86_64_PC8		R_AMD64_PC8
86 #define	R_X86_64_DTPMOD64	R_AMD64_DTPMOD64
87 #define	R_X86_64_DTPOFF64	R_AMD64_DTPOFF64
88 #define	R_X86_64_TPOFF64	R_AMD64_TPOFF64
89 #define	R_X86_64_TLSGD		R_AMD64_TLSGD
90 #define	R_X86_64_TLSLD		R_AMD64_TLSLD
91 #define	R_X86_64_DTPOFF32	R_AMD64_DTPOFF32
92 #define	R_X86_64_GOTTPOFF	R_AMD64_GOTTPOFF
93 #define	R_X86_64_TPOFF32	R_AMD64_TPOFF32
94 #define	R_X86_64_PC64		R_AMD64_PC64
95 #define	R_X86_64_GOTPC32	R_AMD64_GOTPC32
96 #define	R_X86_64_GOTOFF64	R_AMD64_GOTOFF64
97 #define	R_X86_64_NUM		R_AMD64_NUM
98 
99 
100 #define	ELF_AMD64_MAXPGSZ	0x100000	/* maximum page size */
101 
102 /*
103  * processor specific section types
104  */
105 #define	SHT_AMD64_UNWIND	0x70000001	/* unwind information */
106 
107 
108 /*
109  * NOTE: PT_SUNW_UNWIND is defined in the OS specific range
110  *	 to conform with the amd64 psABI.
111  */
112 
113 #define	SHF_AMD64_LARGE		0x10000000
114 #define	SHF_X86_64_LARGE	SHF_AMD64_LARGE
115 #define	SHF_ORDERED		0x40000000
116 #define	SHF_EXCLUDE		0x80000000
117 
118 #define	SHN_BEFORE		0xff00
119 #define	SHN_AFTER		0xff01
120 #define	SHN_AMD64_LCOMMON	0xff02
121 #define	SHN_X86_64_LCOMMON	SHN_AMD64_LCOMMON
122 
123 
124 #ifdef	__cplusplus
125 }
126 #endif
127 
128 #endif	/* _SYS_ELF_AMD64_H */
129