annotate usr/src/cmd/sgs/include/sparc/machdep_sparc.h @ 13004:92dfdb3a48cc

6935867 .dynamic could be readonly in sharable objects
author Rod Evans <Rod.Evans@Oracle.COM>
date Mon, 02 Aug 2010 14:04:48 -0700
parents d7ef53deac3f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
1 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
2 * CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
3 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
5 * Common Development and Distribution License (the "License").
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
6 * You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
7 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
10 * See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
11 * and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
12 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
18 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
19 * CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
20 */
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
21
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
22 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
23 * Copyright (c) 1988 AT&T
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
24 * All Rights Reserved
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
25 *
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
26 * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
27 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
28 * Global include file for all sgs SPARC machine dependent macros, constants
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
29 * and declarations.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
30 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
31
6206
6b0ed502a8e7 PSARC 2008/179 cross link-editor
ab196087
parents: 5152
diff changeset
32 #ifndef _MACHDEP_SPARC_H
6b0ed502a8e7 PSARC 2008/179 cross link-editor
ab196087
parents: 5152
diff changeset
33 #define _MACHDEP_SPARC_H
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
34
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
35 #include <link.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
36 #include <sys/machelf.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
37
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
38 #ifdef __cplusplus
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
39 extern "C" {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
40 #endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
41
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
42 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
43 * Elf header information.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
44 */
6206
6b0ed502a8e7 PSARC 2008/179 cross link-editor
ab196087
parents: 5152
diff changeset
45 #define M_MACH_32 EM_SPARC
6b0ed502a8e7 PSARC 2008/179 cross link-editor
ab196087
parents: 5152
diff changeset
46 #define M_MACH_64 EM_SPARCV9
6b0ed502a8e7 PSARC 2008/179 cross link-editor
ab196087
parents: 5152
diff changeset
47
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
48 #ifdef _ELF64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
49 #define M_MACH EM_SPARCV9
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
50 #define M_CLASS ELFCLASS64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
51 #else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
52 #define M_MACH EM_SPARC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
53 #define M_CLASS ELFCLASS32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
54 #endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
55 #define M_MACHPLUS EM_SPARC32PLUS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
56 #define M_DATA ELFDATA2MSB
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
57 #define M_FLAGSPLUS EF_SPARC_32PLUS
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
58
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
59 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
60 * Page boundary Macros: truncate to previous page boundary and round to
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
61 * next page boundary (refer to generic macros in ../sgs.h also).
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
62 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
63 #define M_PTRUNC(X) ((X) & ~(syspagsz - 1))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
64 #define M_PROUND(X) (((X) + syspagsz - 1) & ~(syspagsz - 1))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
65
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
66 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
67 * Segment boundary macros: truncate to previous segment boundary and round
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
68 * to next page boundary.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
69 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
70 #ifndef M_SEGSIZE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
71 #define M_SEGSIZE ELF_SPARC_MAXPGSZ
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
72 #endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
73 #define M_STRUNC(X) ((X) & ~(M_SEGSIZE - 1))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
74 #define M_SROUND(X) (((X) + M_SEGSIZE - 1) & ~(M_SEGSIZE - 1))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
75
8598
0867fc633d66 6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents: 8501
diff changeset
76 /*
0867fc633d66 6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents: 8501
diff changeset
77 * Relocation type macro.
0867fc633d66 6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents: 8501
diff changeset
78 */
0867fc633d66 6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents: 8501
diff changeset
79 #define M_RELOC Rela
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
80
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
81 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
82 * TLS static segments must be rounded to the following requirements,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
83 * due to libthread stack allocation.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
84 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
85 #if defined(_ELF64)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
86 #define M_TLSSTATALIGN 0x10
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
87 #else
2647
e440e3da2a6f 6464235 executing the 64-bit ld(1) should be easy
rie
parents: 1618
diff changeset
88 #define M_TLSSTATALIGN 0x08
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
89 #endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
90
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
91 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
92 * Instruction encodings.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
93 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
94 #define M_SAVESP64 0x9de3bfc0 /* save %sp, -64, %sp */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
95 #define M_CALL 0x40000000
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
96 #define M_JMPL 0x81c06000 /* jmpl %g1 + simm13, %g0 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
97 #define M_SETHIG0 0x01000000 /* sethi %hi(val), %g0 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
98 #define M_SETHIG1 0x03000000 /* sethi %hi(val), %g1 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
99 #define M_STO7G1IM 0xde206000 /* st %o7,[%g1 + %lo(val)] */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
100 #define M_SUBFPSPG1 0x8227800e /* sub %fp,%sp,%g1 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
101 #define M_NOP 0x01000000 /* sethi 0, %o0 (nop) */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
102 #define M_BA_A 0x30800000 /* ba,a */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
103 #define M_BA_A_PT 0x30480000 /* ba,a %icc, <dst> */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
104 #define M_MOVO7TOG1 0x8210000f /* mov %o7, %g1 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
105 #define M_MOVO7TOG5 0x8a10000f /* mov %o7, %g5 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
106 #define M_MOVI7TOG1 0x8210001f /* mov %i7, %g1 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
107 #define M_BA_A_XCC 0x30680000 /* ba,a %xcc */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
108 #define M_JMPL_G5G0 0x81c16000 /* jmpl %g5 + 0, %g0 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
109 #define M_XNOR_G5G1 0x82396000 /* xnor %g5, 0, %g1 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
110
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
111
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
112 #define M_BIND_ADJ 4 /* adjustment for end of */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
113 /* elf_rtbndr() address */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
114
10201
47013accbd9c 6863263 libproc doesn't access in-core elf data correctly
Edward Pilatowicz <Edward.Pilatowicz@Sun.COM>
parents: 9085
diff changeset
115 /* transition flags for got sizing */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
116 #define M_GOT_LARGE (Sword)(-M_GOT_MAXSMALL - 1)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
117 #define M_GOT_SMALL (Sword)(-M_GOT_MAXSMALL - 2)
5152
fa5ab16f3606 5035454 mixing -Kpic and -KPIC may cause SIGSEGV with -xarch=v9
ab196087
parents: 4665
diff changeset
118 #define M_GOT_MIXED (Sword)(-M_GOT_MAXSMALL - 3)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
119
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
120 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
121 * Other machine dependent entities
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
122 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
123 #ifdef _ELF64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
124 #define M_SEGM_ALIGN ELF_SPARCV9_MAXPGSZ
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
125 /*
8501
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
126 * Put default 64-bit programs above 4 gigabytes to help insure correctness, so
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
127 * that any 64-bit programs that truncate pointers will fault now instead of
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
128 * corrupting itself and dying mysteriously. 64-bit programs can also be
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
129 * restricted to a 32-bit address space (SF1_SUNW_ADDR32), and these programs
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
130 * provide an alternative origin.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
131 */
8501
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
132 #define M_SEGM_ORIGIN (Addr)0x100000000ULL /* default 1st segment origin */
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
133 #define M_SEGM_AORIGIN (Addr)0x100000ULL /* alternative 1st segment */
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
134 /* origin */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
135 #else
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
136 #define M_SEGM_ALIGN ELF_SPARC_MAXPGSZ
8501
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
137 #define M_SEGM_ORIGIN (Addr)0x10000 /* default 1st segment origin */
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
138 #define M_SEGM_AORIGIN M_SEGM_ORIGIN /* alternative 1st segment */
e544a13d2b41 6789925 64-bit applications with SF1_SUNW_ADDR32 require non-default starting address
Rod Evans <Rod.Evans@Sun.COM>
parents: 7833
diff changeset
139 /* origin */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
140 #endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
141
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
142 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
143 * Make common relocation information transparent to the common code
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
144 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
145 #define M_REL_DT_TYPE DT_RELA /* .dynamic entry */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
146 #define M_REL_DT_SIZE DT_RELASZ /* .dynamic entry */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
147 #define M_REL_DT_ENT DT_RELAENT /* .dynamic entry */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
148 #define M_REL_DT_COUNT DT_RELACOUNT /* .dynamic entry */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
149 #define M_REL_SHT_TYPE SHT_RELA /* section header type */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
150 #define M_REL_ELF_TYPE ELF_T_RELA /* data buffer type */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
151
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
152 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
153 * Make common relocation types transparent to the common code
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
154 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
155 #define M_R_NONE R_SPARC_NONE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
156 #define M_R_GLOB_DAT R_SPARC_GLOB_DAT
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
157 #define M_R_COPY R_SPARC_COPY
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
158 #define M_R_RELATIVE R_SPARC_RELATIVE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
159 #define M_R_JMP_SLOT R_SPARC_JMP_SLOT
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
160 #define M_R_REGISTER R_SPARC_REGISTER
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
161 #define M_R_FPTR R_SPARC_NONE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
162 #define M_R_NUM R_SPARC_NUM
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
163
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
164 #ifdef _ELF64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
165 #define M_R_ARRAYADDR R_SPARC_64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
166 #define M_R_DTPMOD R_SPARC_TLS_DTPMOD64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
167 #define M_R_DTPOFF R_SPARC_TLS_DTPOFF64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
168 #define M_R_TPOFF R_SPARC_TLS_TPOFF64
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
169 #else /* _ELF32 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
170 #define M_R_ARRAYADDR R_SPARC_32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
171 #define M_R_DTPMOD R_SPARC_TLS_DTPMOD32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
172 #define M_R_DTPOFF R_SPARC_TLS_DTPOFF32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
173 #define M_R_TPOFF R_SPARC_TLS_TPOFF32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
174 #endif /* _ELF64 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
175
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
176
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
177 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
178 * Make register symbols transparent to common code
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
179 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
180 #define M_DT_REGISTER DT_SPARC_REGISTER
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
181
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
182 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
183 * Make plt section information transparent to the common code.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
184 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
185 #define M_PLT_SHF_FLAGS (SHF_ALLOC | SHF_WRITE | SHF_EXECINSTR)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
186
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
187 /*
11734
d29dc9c2b6c5 6916788 ld version 2 mapfile syntax
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10201
diff changeset
188 * Make default data segment and stack flags transparent to the common code.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
189 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
190 #define M_DATASEG_PERM (PF_R | PF_W | PF_X)
11734
d29dc9c2b6c5 6916788 ld version 2 mapfile syntax
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10201
diff changeset
191 #ifdef _ELF64
d29dc9c2b6c5 6916788 ld version 2 mapfile syntax
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10201
diff changeset
192 #define M_STACK_PERM (PF_R | PF_W)
d29dc9c2b6c5 6916788 ld version 2 mapfile syntax
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10201
diff changeset
193 #else
d29dc9c2b6c5 6916788 ld version 2 mapfile syntax
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10201
diff changeset
194 #define M_STACK_PERM (PF_R | PF_W | PF_X)
d29dc9c2b6c5 6916788 ld version 2 mapfile syntax
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10201
diff changeset
195 #endif
d29dc9c2b6c5 6916788 ld version 2 mapfile syntax
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 10201
diff changeset
196
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
197 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
198 * Define a set of identifies for special sections. These allow the sections
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
199 * to be ordered within the output file image. These values should be
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
200 * maintained consistently, where appropriate, in each platform specific header
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
201 * file.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
202 *
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
203 * - null identifies that this section does not need to be added to the
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
204 * output image (ie. shared object sections or sections we're going to
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
205 * recreate (sym tables, string tables, relocations, etc.)).
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
206 *
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
207 * - any user defined section will be first in the associated segment.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
208 *
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
209 * - interp and capabilities sections are next, as these are accessed
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
210 * immediately the first page of the image is mapped.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
211 *
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
212 * - objects that do not provide an interp normally have a read-only
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
213 * .dynamic section that comes next (in this case, there is no need to
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
214 * update a DT_DEBUG entry at runtime).
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
215 *
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
216 * - the syminfo, hash, dynsym, dynstr and rel's are grouped together as
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
217 * these will all be accessed together by ld.so.1 to perform relocations.
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
218 *
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
219 * - the got, dynamic, and plt are grouped together as these may also be
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
220 * accessed first by ld.so.1 to perform relocations, fill in DT_DEBUG
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
221 * (executables only), and .plt[0].
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
222 *
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
223 * - unknown sections (stabs, comments, etc.) go at the end.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
224 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
225 * Note that .tlsbss/.bss are given the largest identifiers. This insures that
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
226 * if any unknown sections become associated to the same segment as the .bss,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
227 * the .bss sections are always the last section in the segment.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
228 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
229 #define M_ID_NULL 0x00
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
230 #define M_ID_USER 0x01
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
231
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
232 #define M_ID_INTERP 0x02 /* SHF_ALLOC */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
233 #define M_ID_CAP 0x03
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
234 #define M_ID_CAPINFO 0x04
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
235 #define M_ID_CAPCHAIN 0x05
11827
d7ef53deac3f 6918143 symbol capabilities
Rod Evans <Rod.Evans@Sun.COM>
parents: 11734
diff changeset
236
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
237 #define M_ID_DYNAMIC 0x06 /* if no .interp, then no */
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
238 /* DT_DEBUG is required */
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
239 #define M_ID_UNWINDHDR 0x07
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
240 #define M_ID_UNWIND 0x08
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
241
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
242 #define M_ID_SYMINFO 0x09
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
243 #define M_ID_HASH 0x0a
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
244 #define M_ID_LDYNSYM 0x0b /* always right before DYNSYM */
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
245 #define M_ID_DYNSYM 0x0c
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
246 #define M_ID_DYNSTR 0x0d
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
247 #define M_ID_VERSION 0x0e
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
248 #define M_ID_DYNSORT 0x0f
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
249 #define M_ID_REL 0x10
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
250 #define M_ID_ARRAY 0x11
11827
d7ef53deac3f 6918143 symbol capabilities
Rod Evans <Rod.Evans@Sun.COM>
parents: 11734
diff changeset
251 #define M_ID_TEXT 0x12 /* SHF_ALLOC + SHF_EXECINSTR */
9085
ff7eb0bace56 6813909 generalize eh_frame support to non-amd64 platforms
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents: 8598
diff changeset
252 #define M_ID_DATA 0x20
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
253
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
254 /* M_ID_USER 0x01 dual entry - listed above */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
255 #define M_ID_GOTDATA 0x02 /* SHF_ALLOC + SHF_WRITE */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
256 #define M_ID_GOT 0x03
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
257 #define M_ID_PLT 0x04
13004
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
258 /* M_ID_DYNAMIC 0x06 dual entry - listed above */
92dfdb3a48cc 6935867 .dynamic could be readonly in sharable objects
Rod Evans <Rod.Evans@Oracle.COM>
parents: 11827
diff changeset
259 /* M_ID_UNWIND 0x08 dual entry - listed above */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
260
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
261 #define M_ID_UNKNOWN 0xfc /* just before TLS */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
262
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
263 #define M_ID_TLS 0xfd /* just before bss */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
264 #define M_ID_TLSBSS 0xfe
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
265 #define M_ID_BSS 0xff
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
266
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
267 #define M_ID_SYMTAB_NDX 0x02 /* ! SHF_ALLOC */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
268 #define M_ID_SYMTAB 0x03
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
269 #define M_ID_STRTAB 0x04
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
270 #define M_ID_DYNSYM_NDX 0x05
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
271 #define M_ID_NOTE 0x06
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
272
6206
6b0ed502a8e7 PSARC 2008/179 cross link-editor
ab196087
parents: 5152
diff changeset
273
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
274 #ifdef __cplusplus
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
275 }
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
276 #endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
277
6206
6b0ed502a8e7 PSARC 2008/179 cross link-editor
ab196087
parents: 5152
diff changeset
278 #endif /* _MACHDEP_SPARC_H */