Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/rtld_db.h
+++ new/usr/src/head/rtld_db.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 + *
22 24 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 25 * Use is subject to license terms.
24 26 */
25 27
26 28 #ifndef _RTLD_DB_H
27 29 #define _RTLD_DB_H
28 30
29 -#pragma ident "%Z%%M% %I% %E% SMI"
30 -
31 -
32 31 #ifdef __cplusplus
33 32 extern "C" {
34 33 #endif
35 34
36 35 #include <sys/types.h>
37 36 #include <sys/lwp.h>
38 37 #include <sys/elf.h>
39 38 #include <link.h>
40 39 #include <proc_service.h>
41 40
42 41
43 42 /*
44 43 * librtld_db interface versions
45 44 */
46 45 #define RD_VERSION1 1
47 46 #define RD_VERSION2 2
48 47 #define RD_VERSION3 3
49 48 #define RD_VERSION4 4
50 49 #define RD_VERSION RD_VERSION4
51 50
52 51 typedef enum {
53 52 RD_ERR, /* generic */
54 53 RD_OK, /* generic "call" succeeded */
55 54 RD_NOCAPAB, /* capability not available */
56 55 RD_DBERR, /* import service failed */
57 56 RD_NOBASE, /* 5.x: aux tag AT_BASE not found */
58 57 RD_NODYNAM, /* symbol 'DYNAMIC' not found */
59 58 RD_NOMAPS /* link-maps are not yet available */
60 59 } rd_err_e;
61 60
62 61
63 62 /*
64 63 * ways that the event notification can take place:
65 64 */
66 65 typedef enum {
67 66 RD_NOTIFY_BPT, /* set break-point at address */
68 67 RD_NOTIFY_AUTOBPT, /* 4.x compat. not used in 5.x */
69 68 RD_NOTIFY_SYSCALL /* watch for syscall */
70 69 } rd_notify_e;
71 70
72 71 /*
73 72 * information on ways that the event notification can take place:
74 73 */
75 74 typedef struct rd_notify {
76 75 rd_notify_e type;
77 76 union {
78 77 psaddr_t bptaddr; /* break point address */
79 78 long syscallno; /* system call id */
80 79 } u;
81 80 } rd_notify_t;
82 81
83 82 /*
84 83 * information about event instance:
85 84 */
86 85 typedef enum {
87 86 RD_NOSTATE = 0, /* no state information */
88 87 RD_CONSISTENT, /* link-maps are stable */
89 88 RD_ADD, /* currently adding object to link-maps */
90 89 RD_DELETE /* currently deleteing object from link-maps */
91 90 } rd_state_e;
92 91
93 92 typedef struct rd_event_msg {
94 93 rd_event_e type;
95 94 union {
96 95 rd_state_e state; /* for DLACTIVITY */
97 96 } u;
98 97 } rd_event_msg_t;
99 98
100 99
101 100 /*
102 101 * iteration over load objects
103 102 */
104 103 typedef struct rd_loadobj {
105 104 psaddr_t rl_nameaddr; /* address of the name in user space */
106 105 unsigned rl_flags;
107 106 psaddr_t rl_base; /* base of address of code */
108 107 psaddr_t rl_data_base; /* base of address of data */
109 108 Lmid_t rl_lmident; /* ident of link map */
110 109 psaddr_t rl_refnameaddr; /* reference name of filter in user */
111 110 /* space. If non null object is a */
112 111 /* filter. */
113 112 psaddr_t rl_plt_base; /* These fields are present for 4.x */
114 113 unsigned rl_plt_size; /* compatibility and are not */
115 114 /* currently used in SunOS5.x */
116 115 psaddr_t rl_bend; /* end of image (text+data+bss) */
117 116 psaddr_t rl_padstart; /* start of padding */
118 117 psaddr_t rl_padend; /* end of image after padding */
119 118 psaddr_t rl_dynamic; /* points to the DYNAMIC section */
120 119 /* in the target process */
121 120 unsigned long rl_tlsmodid; /* module ID for TLS references */
122 121 } rd_loadobj_t;
123 122
124 123 /*
125 124 * Values for rl_flags
126 125 */
127 126 #define RD_FLG_MEM_OBJECT 0x0001 /* Identifies this object as */
↓ open down ↓ |
86 lines elided |
↑ open up ↑ |
128 127 /* originating from a relocatable */
129 128 /* module which was dynamically */
130 129 /* loaded */
131 130
132 131 /*
133 132 * Commands for rd_ctl()
134 133 */
135 134 #define RD_CTL_SET_HELPPATH 0x01 /* Set the path used to find helpers */
136 135
137 136 typedef struct rd_agent rd_agent_t;
138 -#ifdef __STDC__
139 137 typedef int rl_iter_f(const rd_loadobj_t *, void *);
140 -#else
141 -typedef int rl_iter_f();
142 -#endif
143 138
144 139
145 140 /*
146 141 * PLT skipping
147 142 */
148 143 typedef enum {
149 144 RD_RESOLVE_NONE, /* don't do anything special */
150 145 RD_RESOLVE_STEP, /* step 'pi_nstep' instructions */
151 146 RD_RESOLVE_TARGET, /* resolved target is in 'pi_target' */
152 147 RD_RESOLVE_TARGET_STEP /* put a bpt on target, then step nstep times */
153 148 } rd_skip_e;
154 149
155 150
156 151 typedef struct rd_plt_info {
157 152 rd_skip_e pi_skip_method;
158 153 long pi_nstep;
159 154 psaddr_t pi_target;
160 155 psaddr_t pi_baddr;
161 156 unsigned int pi_flags;
162 157 } rd_plt_info_t;
163 158
164 159
165 160 /*
166 161 * Values for pi_flags
167 162 */
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
168 163 #define RD_FLG_PI_PLTBOUND 0x0001 /* Indicates that the PLT */
169 164 /* has been bound - and that */
170 165 /* pi_baddr will contain its */
171 166 /* destination address */
172 167
173 168 struct ps_prochandle;
174 169
175 170 /*
176 171 * librtld_db.so entry points
177 172 */
178 -#ifdef __STDC__
179 173 extern void rd_delete(rd_agent_t *);
180 174 extern char *rd_errstr(rd_err_e rderr);
181 175 extern rd_err_e rd_event_addr(rd_agent_t *, rd_event_e, rd_notify_t *);
182 176 extern rd_err_e rd_event_enable(rd_agent_t *, int);
183 177 extern rd_err_e rd_event_getmsg(rd_agent_t *, rd_event_msg_t *);
184 178 extern rd_err_e rd_init(int);
185 179 extern rd_err_e rd_ctl(int, void *);
186 180 extern rd_err_e rd_loadobj_iter(rd_agent_t *, rl_iter_f *,
187 181 void *);
188 182 extern void rd_log(const int);
189 183 extern rd_agent_t *rd_new(struct ps_prochandle *);
190 184 extern rd_err_e rd_objpad_enable(struct rd_agent *, size_t);
191 185 extern rd_err_e rd_plt_resolution(rd_agent_t *, psaddr_t, lwpid_t,
192 186 psaddr_t, rd_plt_info_t *);
193 187 extern rd_err_e rd_get_dyns(rd_agent_t *, psaddr_t, void **, size_t *);
194 188 extern rd_err_e rd_reset(struct rd_agent *);
195 -#else /* !__STDC__ */
196 -extern void rd_delete();
197 -extern char *rd_errstr();
198 -extern rd_err_e rd_event_addr();
199 -extern rd_err_e rd_event_enable();
200 -extern rd_err_e rd_event_getmsg();
201 -extern rd_err_e rd_init();
202 -extern rd_err_e rd_ctl();
203 -extern rd_err_e rd_loadobj_iter();
204 -extern void rd_log();
205 -extern rd_agent_t *rd_new();
206 -extern rd_err_e rd_objpad_enable();
207 -extern rd_err_e rd_plt_resolution();
208 -extern rd_err_e rd_get_dyns();
209 -extern rd_err_e rd_reset();
210 -#endif /* !__STDC__ */
211 189
212 190 #ifdef __cplusplus
213 191 }
214 192 #endif
215 193
216 194 #endif /* _RTLD_DB_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX