author | Rod Evans <Rod.Evans@Sun.COM> |
Wed, 19 May 2010 22:33:49 -0700 | |
changeset 12449 | a87750d92895 |
parent 11827 | d7ef53deac3f |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
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:
546
diff
changeset
|
5 |
* Common Development and Distribution License (the "License"). |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
6 |
* You may not use this file except in compliance with the License. |
0 | 7 |
* |
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
21 |
|
0 | 22 |
/* |
6812 | 23 |
* Copyright (c) 1988 AT&T |
24 |
* All Rights Reserved |
|
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
25 |
* |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
26 |
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. |
6812 | 27 |
*/ |
28 |
||
0 | 29 |
/* |
30 |
* x86 machine dependent and ELF file class dependent functions. |
|
31 |
* Contains routines for performing function binding and symbol relocations. |
|
32 |
*/ |
|
33 |
||
34 |
#include <stdio.h> |
|
35 |
#include <sys/elf.h> |
|
36 |
#include <sys/elf_386.h> |
|
37 |
#include <sys/mman.h> |
|
38 |
#include <dlfcn.h> |
|
39 |
#include <synch.h> |
|
40 |
#include <string.h> |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
41 |
#include <debug.h> |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
42 |
#include <reloc.h> |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
43 |
#include <conv.h> |
0 | 44 |
#include "_rtld.h" |
45 |
#include "_audit.h" |
|
46 |
#include "_elf.h" |
|
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
47 |
#include "_inline_gen.h" |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
48 |
#include "_inline_reloc.h" |
0 | 49 |
#include "msg.h" |
50 |
||
51 |
extern void elf_rtbndr(Rt_map *, ulong_t, caddr_t); |
|
52 |
||
53 |
int |
|
54 |
elf_mach_flags_check(Rej_desc *rej, Ehdr *ehdr) |
|
55 |
{ |
|
56 |
/* |
|
57 |
* Check machine type and flags. |
|
58 |
*/ |
|
59 |
if (ehdr->e_flags != 0) { |
|
60 |
rej->rej_type = SGS_REJ_BADFLAG; |
|
61 |
rej->rej_info = (uint_t)ehdr->e_flags; |
|
62 |
return (0); |
|
63 |
} |
|
64 |
return (1); |
|
65 |
} |
|
66 |
||
67 |
void |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
68 |
ldso_plt_init(Rt_map *lmp) |
0 | 69 |
{ |
70 |
/* |
|
71 |
* There is no need to analyze ld.so because we don't map in any of |
|
72 |
* its dependencies. However we may map these dependencies in later |
|
73 |
* (as if ld.so had dlopened them), so initialize the plt and the |
|
74 |
* permission information. |
|
75 |
*/ |
|
76 |
if (PLTGOT(lmp)) |
|
77 |
elf_plt_init((PLTGOT(lmp)), (caddr_t)lmp); |
|
78 |
} |
|
79 |
||
80 |
static const uchar_t dyn_plt_template[] = { |
|
81 |
/* 0x00 */ 0x55, /* pushl %ebp */ |
|
82 |
/* 0x01 */ 0x8b, 0xec, /* movl %esp, %ebp */ |
|
83 |
/* 0x03 */ 0x68, 0x00, 0x00, 0x00, 0x00, /* pushl trace_fields */ |
|
84 |
/* 0x08 */ 0xe9, 0xfc, 0xff, 0xff, 0xff, 0xff /* jmp elf_plt_trace */ |
|
85 |
}; |
|
86 |
int dyn_plt_ent_size = sizeof (dyn_plt_template); |
|
87 |
||
88 |
/* |
|
89 |
* the dynamic plt entry is: |
|
90 |
* |
|
91 |
* pushl %ebp |
|
92 |
* movl %esp, %ebp |
|
93 |
* pushl tfp |
|
94 |
* jmp elf_plt_trace |
|
95 |
* dyn_data: |
|
96 |
* .align 4 |
|
97 |
* uintptr_t reflmp |
|
98 |
* uintptr_t deflmp |
|
99 |
* uint_t symndx |
|
100 |
* uint_t sb_flags |
|
101 |
* Sym symdef |
|
102 |
*/ |
|
103 |
static caddr_t |
|
104 |
elf_plt_trace_write(uint_t roffset, Rt_map *rlmp, Rt_map *dlmp, Sym *sym, |
|
105 |
uint_t symndx, uint_t pltndx, caddr_t to, uint_t sb_flags, int *fail) |
|
106 |
{ |
|
107 |
extern int elf_plt_trace(); |
|
108 |
ulong_t got_entry; |
|
109 |
uchar_t *dyn_plt; |
|
110 |
uintptr_t *dyndata; |
|
111 |
||
112 |
/* |
|
113 |
* We only need to add the glue code if there is an auditing |
|
114 |
* library that is interested in this binding. |
|
115 |
*/ |
|
116 |
dyn_plt = (uchar_t *)((uintptr_t)AUDINFO(rlmp)->ai_dynplts + |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
117 |
(pltndx * dyn_plt_ent_size)); |
0 | 118 |
|
119 |
/* |
|
120 |
* Have we initialized this dynamic plt entry yet? If we haven't do it |
|
121 |
* now. Otherwise this function has been called before, but from a |
|
122 |
* different plt (ie. from another shared object). In that case |
|
123 |
* we just set the plt to point to the new dyn_plt. |
|
124 |
*/ |
|
125 |
if (*dyn_plt == 0) { |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
126 |
Sym *symp; |
0 | 127 |
Word symvalue; |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
128 |
Lm_list *lml = LIST(rlmp); |
0 | 129 |
|
130 |
(void) memcpy((void *)dyn_plt, dyn_plt_template, |
|
131 |
sizeof (dyn_plt_template)); |
|
132 |
dyndata = (uintptr_t *)((uintptr_t)dyn_plt + |
|
133 |
ROUND(sizeof (dyn_plt_template), M_WORD_ALIGN)); |
|
134 |
||
135 |
/* |
|
136 |
* relocate: |
|
137 |
* pushl dyn_data |
|
138 |
*/ |
|
139 |
symvalue = (Word)dyndata; |
|
5189
66a4f4f8a159
6610591 do_reloc() should not require unused arguments
ab196087
parents:
4947
diff
changeset
|
140 |
if (do_reloc_rtld(R_386_32, &dyn_plt[4], &symvalue, |
0 | 141 |
MSG_ORIG(MSG_SYM_LADYNDATA), |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
142 |
MSG_ORIG(MSG_SPECFIL_DYNPLT), lml) == 0) { |
0 | 143 |
*fail = 1; |
144 |
return (0); |
|
145 |
} |
|
146 |
||
147 |
/* |
|
148 |
* jmps are relative, so I need to figure out the relative |
|
149 |
* address to elf_plt_trace. |
|
150 |
* |
|
151 |
* relocating: |
|
152 |
* jmp elf_plt_trace |
|
153 |
*/ |
|
154 |
symvalue = (ulong_t)(elf_plt_trace) - (ulong_t)(dyn_plt + 9); |
|
5189
66a4f4f8a159
6610591 do_reloc() should not require unused arguments
ab196087
parents:
4947
diff
changeset
|
155 |
if (do_reloc_rtld(R_386_PC32, &dyn_plt[9], &symvalue, |
0 | 156 |
MSG_ORIG(MSG_SYM_ELFPLTTRACE), |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
157 |
MSG_ORIG(MSG_SPECFIL_DYNPLT), lml) == 0) { |
0 | 158 |
*fail = 1; |
159 |
return (0); |
|
160 |
} |
|
161 |
||
162 |
*dyndata++ = (uintptr_t)rlmp; |
|
163 |
*dyndata++ = (uintptr_t)dlmp; |
|
164 |
*dyndata++ = (uint_t)symndx; |
|
165 |
*dyndata++ = (uint_t)sb_flags; |
|
166 |
symp = (Sym *)dyndata; |
|
167 |
*symp = *sym; |
|
168 |
symp->st_name += (Word)STRTAB(dlmp); |
|
169 |
symp->st_value = (Addr)to; |
|
170 |
} |
|
171 |
||
172 |
got_entry = (ulong_t)roffset; |
|
173 |
*(ulong_t *)got_entry = (ulong_t)dyn_plt; |
|
174 |
return ((caddr_t)dyn_plt); |
|
175 |
} |
|
176 |
||
177 |
/* |
|
178 |
* Function binding routine - invoked on the first call to a function through |
|
179 |
* the procedure linkage table; |
|
180 |
* passes first through an assembly language interface. |
|
181 |
* |
|
182 |
* Takes the offset into the relocation table of the associated |
|
183 |
* relocation entry and the address of the link map (rt_private_map struct) |
|
184 |
* for the entry. |
|
185 |
* |
|
186 |
* Returns the address of the function referenced after re-writing the PLT |
|
187 |
* entry to invoke the function directly. |
|
188 |
* |
|
189 |
* On error, causes process to terminate with a signal. |
|
190 |
*/ |
|
191 |
ulong_t |
|
192 |
elf_bndr(Rt_map *lmp, ulong_t reloff, caddr_t from) |
|
193 |
{ |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
194 |
Rt_map *nlmp, *llmp; |
0 | 195 |
ulong_t addr, symval, rsymndx; |
196 |
char *name; |
|
197 |
Rel *rptr; |
|
5220
caa2c0074088
PSARC/2007/559 new symbol visibilities - EXPORTED, SINGLETON, and ELIMINATE
rie
parents:
5189
diff
changeset
|
198 |
Sym *rsym, *nsym; |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
199 |
uint_t binfo, sb_flags = 0, dbg_class; |
0 | 200 |
Slookup sl; |
11827 | 201 |
Sresult sr; |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
202 |
int entry, lmflags; |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
203 |
Lm_list *lml; |
0 | 204 |
|
205 |
/* |
|
206 |
* For compatibility with libthread (TI_VERSION 1) we track the entry |
|
207 |
* value. A zero value indicates we have recursed into ld.so.1 to |
|
208 |
* further process a locking request. Under this recursion we disable |
|
209 |
* tsort and cleanup activities. |
|
210 |
*/ |
|
6515
10dab2b883e0
6678310 using LD_AUDIT, ld.so.1 calls shared library's .init before library is fully relocated
raf
parents:
6387
diff
changeset
|
211 |
entry = enter(0); |
0 | 212 |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
213 |
lml = LIST(lmp); |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
214 |
if ((lmflags = lml->lm_flags) & LML_FLG_RTLDLM) { |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
215 |
dbg_class = dbg_desc->d_class; |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
216 |
dbg_desc->d_class = 0; |
0 | 217 |
} |
218 |
||
219 |
/* |
|
220 |
* Perform some basic sanity checks. If we didn't get a load map or |
|
221 |
* the relocation offset is invalid then its possible someone has walked |
|
222 |
* over the .got entries or jumped to plt0 out of the blue. |
|
223 |
*/ |
|
224 |
if (!lmp || ((reloff % sizeof (Rel)) != 0)) { |
|
4734
a4708faa3e85
6583742 ELF string conversion library needs to lose static writable buffers
ab196087
parents:
4679
diff
changeset
|
225 |
Conv_inv_buf_t inv_buf; |
a4708faa3e85
6583742 ELF string conversion library needs to lose static writable buffers
ab196087
parents:
4679
diff
changeset
|
226 |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
227 |
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_PLTREF), |
4734
a4708faa3e85
6583742 ELF string conversion library needs to lose static writable buffers
ab196087
parents:
4679
diff
changeset
|
228 |
conv_reloc_386_type(R_386_JMP_SLOT, 0, &inv_buf), |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
229 |
EC_NATPTR(lmp), EC_XWORD(reloff), EC_NATPTR(from)); |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
230 |
rtldexit(lml, 1); |
0 | 231 |
} |
232 |
||
233 |
/* |
|
234 |
* Use relocation entry to get symbol table entry and symbol name. |
|
235 |
*/ |
|
236 |
addr = (ulong_t)JMPREL(lmp); |
|
237 |
rptr = (Rel *)(addr + reloff); |
|
238 |
rsymndx = ELF_R_SYM(rptr->r_info); |
|
5220
caa2c0074088
PSARC/2007/559 new symbol visibilities - EXPORTED, SINGLETON, and ELIMINATE
rie
parents:
5189
diff
changeset
|
239 |
rsym = (Sym *)((ulong_t)SYMTAB(lmp) + (rsymndx * SYMENT(lmp))); |
caa2c0074088
PSARC/2007/559 new symbol visibilities - EXPORTED, SINGLETON, and ELIMINATE
rie
parents:
5189
diff
changeset
|
240 |
name = (char *)(STRTAB(lmp) + rsym->st_name); |
0 | 241 |
|
242 |
/* |
|
243 |
* Determine the last link-map of this list, this'll be the starting |
|
244 |
* point for any tsort() processing. |
|
245 |
*/ |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
246 |
llmp = lml->lm_tail; |
0 | 247 |
|
248 |
/* |
|
11827 | 249 |
* Find definition for symbol. Initialize the symbol lookup, and |
250 |
* symbol result, data structures. |
|
0 | 251 |
*/ |
5950 | 252 |
SLOOKUP_INIT(sl, name, lmp, lml->lm_head, ld_entry_cnt, 0, |
253 |
rsymndx, rsym, 0, LKUP_DEFT); |
|
11827 | 254 |
SRESULT_INIT(sr, name); |
0 | 255 |
|
11827 | 256 |
if (lookup_sym(&sl, &sr, &binfo, NULL) == 0) { |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
257 |
eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_NOSYM), NAME(lmp), |
0 | 258 |
demangle(name)); |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
259 |
rtldexit(lml, 1); |
0 | 260 |
} |
261 |
||
11827 | 262 |
name = (char *)sr.sr_name; |
263 |
nlmp = sr.sr_dmap; |
|
264 |
nsym = sr.sr_sym; |
|
265 |
||
0 | 266 |
symval = nsym->st_value; |
11827 | 267 |
|
0 | 268 |
if (!(FLAGS(nlmp) & FLG_RT_FIXED) && |
269 |
(nsym->st_shndx != SHN_ABS)) |
|
270 |
symval += ADDR(nlmp); |
|
271 |
if ((lmp != nlmp) && ((FLAGS1(nlmp) & FL1_RT_NOINIFIN) == 0)) { |
|
272 |
/* |
|
273 |
* Record that this new link map is now bound to the caller. |
|
274 |
*/ |
|
275 |
if (bind_one(lmp, nlmp, BND_REFER) == 0) |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
276 |
rtldexit(lml, 1); |
0 | 277 |
} |
278 |
||
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
279 |
if ((lml->lm_tflags | AFLAGS(lmp)) & LML_TFLG_AUD_SYMBIND) { |
0 | 280 |
uint_t symndx = (((uintptr_t)nsym - |
4679 | 281 |
(uintptr_t)SYMTAB(nlmp)) / SYMENT(nlmp)); |
0 | 282 |
symval = audit_symbind(lmp, nlmp, nsym, symndx, symval, |
4679 | 283 |
&sb_flags); |
0 | 284 |
} |
285 |
||
286 |
if (!(rtld_flags & RT_FL_NOBIND)) { |
|
287 |
addr = rptr->r_offset; |
|
288 |
if (!(FLAGS(lmp) & FLG_RT_FIXED)) |
|
289 |
addr += ADDR(lmp); |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
290 |
if (((lml->lm_tflags | AFLAGS(lmp)) & |
0 | 291 |
(LML_TFLG_AUD_PLTENTER | LML_TFLG_AUD_PLTEXIT)) && |
292 |
AUDINFO(lmp)->ai_dynplts) { |
|
293 |
int fail = 0; |
|
294 |
uint_t pltndx = reloff / sizeof (Rel); |
|
295 |
uint_t symndx = (((uintptr_t)nsym - |
|
4679 | 296 |
(uintptr_t)SYMTAB(nlmp)) / SYMENT(nlmp)); |
0 | 297 |
|
298 |
symval = (ulong_t)elf_plt_trace_write(addr, lmp, nlmp, |
|
299 |
nsym, symndx, pltndx, (caddr_t)symval, sb_flags, |
|
300 |
&fail); |
|
301 |
if (fail) |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
302 |
rtldexit(lml, 1); |
0 | 303 |
} else { |
304 |
/* |
|
305 |
* Write standard PLT entry to jump directly |
|
306 |
* to newly bound function. |
|
307 |
*/ |
|
308 |
*(ulong_t *)addr = symval; |
|
309 |
} |
|
310 |
} |
|
311 |
||
312 |
/* |
|
313 |
* Print binding information and rebuild PLT entry. |
|
314 |
*/ |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
315 |
DBG_CALL(Dbg_bind_global(lmp, (Addr)from, (Off)(from - ADDR(lmp)), |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
316 |
(Xword)(reloff / sizeof (Rel)), PLT_T_FULL, nlmp, (Addr)symval, |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
317 |
nsym->st_value, name, binfo)); |
0 | 318 |
|
319 |
/* |
|
320 |
* Complete any processing for newly loaded objects. Note we don't |
|
321 |
* know exactly where any new objects are loaded (we know the object |
|
322 |
* that supplied the symbol, but others may have been loaded lazily as |
|
323 |
* we searched for the symbol), so sorting starts from the last |
|
324 |
* link-map know on entry to this routine. |
|
325 |
*/ |
|
326 |
if (entry) |
|
4679 | 327 |
load_completion(llmp); |
0 | 328 |
|
329 |
/* |
|
330 |
* Some operations like dldump() or dlopen()'ing a relocatable object |
|
331 |
* result in objects being loaded on rtld's link-map, make sure these |
|
332 |
* objects are initialized also. |
|
333 |
*/ |
|
334 |
if ((LIST(nlmp)->lm_flags & LML_FLG_RTLDLM) && LIST(nlmp)->lm_init) |
|
4679 | 335 |
load_completion(nlmp); |
0 | 336 |
|
337 |
/* |
|
338 |
* Make sure the object to which we've bound has had it's .init fired. |
|
339 |
* Cleanup before return to user code. |
|
340 |
*/ |
|
341 |
if (entry) { |
|
342 |
is_dep_init(nlmp, lmp); |
|
6515
10dab2b883e0
6678310 using LD_AUDIT, ld.so.1 calls shared library's .init before library is fully relocated
raf
parents:
6387
diff
changeset
|
343 |
leave(lml, 0); |
0 | 344 |
} |
345 |
||
346 |
if (lmflags & LML_FLG_RTLDLM) |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
347 |
dbg_desc->d_class = dbg_class; |
0 | 348 |
|
349 |
return (symval); |
|
350 |
} |
|
351 |
||
352 |
/* |
|
353 |
* Read and process the relocations for one link object, we assume all |
|
354 |
* relocation sections for loadable segments are stored contiguously in |
|
355 |
* the file. |
|
356 |
*/ |
|
357 |
int |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
358 |
elf_reloc(Rt_map *lmp, uint_t plt, int *in_nfavl, APlist **textrel) |
0 | 359 |
{ |
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
360 |
ulong_t relbgn, relend, relsiz, basebgn, pltbgn, pltend; |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
361 |
ulong_t _pltbgn, _pltend; |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
362 |
ulong_t dsymndx, roffset, rsymndx, psymndx = 0; |
0 | 363 |
uchar_t rtype; |
364 |
long value, pvalue; |
|
365 |
Sym *symref, *psymref, *symdef, *psymdef; |
|
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
366 |
Syminfo *sip; |
0 | 367 |
char *name, *pname; |
368 |
Rt_map *_lmp, *plmp; |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
369 |
int ret = 1, noplt = 0; |
0 | 370 |
int relacount = RELACOUNT(lmp), plthint = 0; |
371 |
Rel *rel; |
|
372 |
uint_t binfo, pbinfo; |
|
5892
b863dde33f1b
6492726 Merge SHF_MERGE|SHF_STRINGS input sections
ab196087
parents:
5220
diff
changeset
|
373 |
APlist *bound = NULL; |
0 | 374 |
|
375 |
/* |
|
376 |
* Although only necessary for lazy binding, initialize the first |
|
377 |
* global offset entry to go to elf_rtbndr(). dbx(1) seems |
|
378 |
* to find this useful. |
|
379 |
*/ |
|
380 |
if ((plt == 0) && PLTGOT(lmp)) { |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
381 |
mmapobj_result_t *mpp; |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
382 |
|
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
383 |
/* |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
384 |
* Make sure the segment is writable. |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
385 |
*/ |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
386 |
if ((((mpp = |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
387 |
find_segment((caddr_t)PLTGOT(lmp), lmp)) != NULL) && |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
388 |
((mpp->mr_prot & PROT_WRITE) == 0)) && |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
389 |
((set_prot(lmp, mpp, 1) == 0) || |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
390 |
(aplist_append(textrel, mpp, AL_CNT_TEXTREL) == NULL))) |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
391 |
return (0); |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
392 |
|
0 | 393 |
elf_plt_init(PLTGOT(lmp), (caddr_t)lmp); |
394 |
} |
|
395 |
||
396 |
/* |
|
397 |
* Initialize the plt start and end addresses. |
|
398 |
*/ |
|
399 |
if ((pltbgn = (ulong_t)JMPREL(lmp)) != 0) |
|
400 |
pltend = pltbgn + (ulong_t)(PLTRELSZ(lmp)); |
|
401 |
||
402 |
relsiz = (ulong_t)(RELENT(lmp)); |
|
403 |
basebgn = ADDR(lmp); |
|
404 |
||
405 |
if (PLTRELSZ(lmp)) |
|
406 |
plthint = PLTRELSZ(lmp) / relsiz; |
|
407 |
||
408 |
/* |
|
409 |
* If we've been called upon to promote an RTLD_LAZY object to an |
|
410 |
* RTLD_NOW then we're only interested in scaning the .plt table. |
|
411 |
* An uninitialized .plt is the case where the associated got entry |
|
412 |
* points back to the plt itself. Determine the range of the real .plt |
|
413 |
* entries using the _PROCEDURE_LINKAGE_TABLE_ symbol. |
|
414 |
*/ |
|
415 |
if (plt) { |
|
416 |
Slookup sl; |
|
11827 | 417 |
Sresult sr; |
0 | 418 |
|
419 |
relbgn = pltbgn; |
|
420 |
relend = pltend; |
|
421 |
if (!relbgn || (relbgn == relend)) |
|
422 |
return (1); |
|
423 |
||
5950 | 424 |
/* |
11827 | 425 |
* Initialize the symbol lookup, and symbol result, data |
426 |
* structures. |
|
5950 | 427 |
*/ |
428 |
SLOOKUP_INIT(sl, MSG_ORIG(MSG_SYM_PLT), lmp, lmp, ld_entry_cnt, |
|
429 |
elf_hash(MSG_ORIG(MSG_SYM_PLT)), 0, 0, 0, LKUP_DEFT); |
|
11827 | 430 |
SRESULT_INIT(sr, MSG_ORIG(MSG_SYM_PLT)); |
0 | 431 |
|
11827 | 432 |
if (elf_find_sym(&sl, &sr, &binfo, NULL) == 0) |
0 | 433 |
return (1); |
434 |
||
11827 | 435 |
symdef = sr.sr_sym; |
0 | 436 |
_pltbgn = symdef->st_value; |
437 |
if (!(FLAGS(lmp) & FLG_RT_FIXED) && |
|
438 |
(symdef->st_shndx != SHN_ABS)) |
|
439 |
_pltbgn += basebgn; |
|
440 |
_pltend = _pltbgn + (((PLTRELSZ(lmp) / relsiz)) * |
|
4679 | 441 |
M_PLT_ENTSIZE) + M_PLT_RESERVSZ; |
0 | 442 |
|
443 |
} else { |
|
444 |
/* |
|
445 |
* The relocation sections appear to the run-time linker as a |
|
446 |
* single table. Determine the address of the beginning and end |
|
447 |
* of this table. There are two different interpretations of |
|
448 |
* the ABI at this point: |
|
449 |
* |
|
450 |
* o The REL table and its associated RELSZ indicate the |
|
451 |
* concatenation of *all* relocation sections (this is the |
|
452 |
* model our link-editor constructs). |
|
453 |
* |
|
454 |
* o The REL table and its associated RELSZ indicate the |
|
455 |
* concatenation of all *but* the .plt relocations. These |
|
456 |
* relocations are specified individually by the JMPREL and |
|
457 |
* PLTRELSZ entries. |
|
458 |
* |
|
459 |
* Determine from our knowledege of the relocation range and |
|
460 |
* .plt range, the range of the total relocation table. Note |
|
461 |
* that one other ABI assumption seems to be that the .plt |
|
462 |
* relocations always follow any other relocations, the |
|
463 |
* following range checking drops that assumption. |
|
464 |
*/ |
|
465 |
relbgn = (ulong_t)(REL(lmp)); |
|
466 |
relend = relbgn + (ulong_t)(RELSZ(lmp)); |
|
467 |
if (pltbgn) { |
|
468 |
if (!relbgn || (relbgn > pltbgn)) |
|
469 |
relbgn = pltbgn; |
|
470 |
if (!relbgn || (relend < pltend)) |
|
471 |
relend = pltend; |
|
472 |
} |
|
473 |
} |
|
474 |
if (!relbgn || (relbgn == relend)) { |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
475 |
DBG_CALL(Dbg_reloc_run(lmp, 0, plt, DBG_REL_NONE)); |
0 | 476 |
return (1); |
477 |
} |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
478 |
DBG_CALL(Dbg_reloc_run(lmp, M_REL_SHT_TYPE, plt, DBG_REL_START)); |
0 | 479 |
|
480 |
/* |
|
481 |
* If we're processing a dynamic executable in lazy mode there is no |
|
482 |
* need to scan the .rel.plt table, however if we're processing a shared |
|
483 |
* object in lazy mode the .got addresses associated to each .plt must |
|
484 |
* be relocated to reflect the location of the shared object. |
|
485 |
*/ |
|
486 |
if (pltbgn && ((MODE(lmp) & RTLD_NOW) == 0) && |
|
487 |
(FLAGS(lmp) & FLG_RT_FIXED)) |
|
488 |
noplt = 1; |
|
489 |
||
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
490 |
sip = SYMINFO(lmp); |
0 | 491 |
/* |
492 |
* Loop through relocations. |
|
493 |
*/ |
|
494 |
while (relbgn < relend) { |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
495 |
mmapobj_result_t *mpp; |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
496 |
uint_t sb_flags = 0; |
0 | 497 |
|
6206 | 498 |
rtype = ELF_R_TYPE(((Rel *)relbgn)->r_info, M_MACH); |
0 | 499 |
|
500 |
/* |
|
501 |
* If this is a RELATIVE relocation in a shared object (the |
|
502 |
* common case), and if we are not debugging, then jump into a |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
503 |
* tighter relocation loop (elf_reloc_relative). |
0 | 504 |
*/ |
505 |
if ((rtype == R_386_RELATIVE) && |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
506 |
((FLAGS(lmp) & FLG_RT_FIXED) == 0) && (DBG_ENABLED == 0)) { |
0 | 507 |
if (relacount) { |
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
508 |
relbgn = elf_reloc_relative_count(relbgn, |
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
509 |
relacount, relsiz, basebgn, lmp, |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
510 |
textrel, 0); |
0 | 511 |
relacount = 0; |
512 |
} else { |
|
513 |
relbgn = elf_reloc_relative(relbgn, relend, |
|
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
514 |
relsiz, basebgn, lmp, textrel, 0); |
0 | 515 |
} |
516 |
if (relbgn >= relend) |
|
517 |
break; |
|
6206 | 518 |
rtype = ELF_R_TYPE(((Rel *)relbgn)->r_info, M_MACH); |
0 | 519 |
} |
520 |
||
521 |
roffset = ((Rel *)relbgn)->r_offset; |
|
522 |
||
523 |
/* |
|
524 |
* If this is a shared object, add the base address to offset. |
|
525 |
*/ |
|
526 |
if (!(FLAGS(lmp) & FLG_RT_FIXED)) { |
|
527 |
/* |
|
528 |
* If we're processing lazy bindings, we have to step |
|
529 |
* through the plt entries and add the base address |
|
530 |
* to the corresponding got entry. |
|
531 |
*/ |
|
532 |
if (plthint && (plt == 0) && |
|
533 |
(rtype == R_386_JMP_SLOT) && |
|
534 |
((MODE(lmp) & RTLD_NOW) == 0)) { |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
535 |
relbgn = elf_reloc_relative_count(relbgn, |
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
536 |
plthint, relsiz, basebgn, lmp, textrel, 0); |
0 | 537 |
plthint = 0; |
538 |
continue; |
|
539 |
} |
|
540 |
roffset += basebgn; |
|
541 |
} |
|
542 |
||
543 |
rsymndx = ELF_R_SYM(((Rel *)relbgn)->r_info); |
|
544 |
rel = (Rel *)relbgn; |
|
545 |
relbgn += relsiz; |
|
546 |
||
547 |
/* |
|
548 |
* Optimizations. |
|
549 |
*/ |
|
550 |
if (rtype == R_386_NONE) |
|
551 |
continue; |
|
552 |
if (noplt && ((ulong_t)rel >= pltbgn) && |
|
553 |
((ulong_t)rel < pltend)) { |
|
554 |
relbgn = pltend; |
|
555 |
continue; |
|
556 |
} |
|
557 |
||
558 |
/* |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
559 |
* If we're promoting plts, determine if this one has already |
0 | 560 |
* been written. |
561 |
*/ |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
562 |
if (plt && ((*(ulong_t *)roffset < _pltbgn) || |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
563 |
(*(ulong_t *)roffset > _pltend))) |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
564 |
continue; |
0 | 565 |
|
566 |
/* |
|
567 |
* If this relocation is not against part of the image |
|
568 |
* mapped into memory we skip it. |
|
569 |
*/ |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
570 |
if ((mpp = find_segment((caddr_t)roffset, lmp)) == NULL) { |
4679 | 571 |
elf_reloc_bad(lmp, (void *)rel, rtype, roffset, |
572 |
rsymndx); |
|
0 | 573 |
continue; |
574 |
} |
|
575 |
||
576 |
binfo = 0; |
|
577 |
/* |
|
578 |
* If a symbol index is specified then get the symbol table |
|
579 |
* entry, locate the symbol definition, and determine its |
|
580 |
* address. |
|
581 |
*/ |
|
582 |
if (rsymndx) { |
|
583 |
/* |
|
12449
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
584 |
* If a Syminfo section is provided, determine if this |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
585 |
* symbol is deferred, and if so, skip this relocation. |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
586 |
*/ |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
587 |
if (sip && is_sym_deferred((ulong_t)rel, basebgn, lmp, |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
588 |
textrel, sip, rsymndx)) |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
589 |
continue; |
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
590 |
|
a87750d92895
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
Rod Evans <Rod.Evans@Sun.COM>
parents:
11827
diff
changeset
|
591 |
/* |
0 | 592 |
* Get the local symbol table entry. |
593 |
*/ |
|
594 |
symref = (Sym *)((ulong_t)SYMTAB(lmp) + |
|
595 |
(rsymndx * SYMENT(lmp))); |
|
596 |
||
597 |
/* |
|
598 |
* If this is a local symbol, just use the base address. |
|
599 |
* (we should have no local relocations in the |
|
600 |
* executable). |
|
601 |
*/ |
|
602 |
if (ELF_ST_BIND(symref->st_info) == STB_LOCAL) { |
|
603 |
value = basebgn; |
|
11827 | 604 |
name = NULL; |
0 | 605 |
|
606 |
/* |
|
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
607 |
* Special case TLS relocations. |
0 | 608 |
*/ |
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
609 |
if (rtype == R_386_TLS_DTPMOD32) { |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
610 |
/* |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
611 |
* Use the TLS modid. |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
612 |
*/ |
0 | 613 |
value = TLSMODID(lmp); |
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
614 |
|
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
615 |
} else if (rtype == R_386_TLS_TPOFF) { |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
616 |
if ((value = elf_static_tls(lmp, symref, |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
617 |
rel, rtype, 0, roffset, 0)) == 0) { |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
618 |
ret = 0; |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
619 |
break; |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
620 |
} |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
621 |
} |
0 | 622 |
} else { |
623 |
/* |
|
624 |
* If the symbol index is equal to the previous |
|
625 |
* symbol index relocation we processed then |
|
626 |
* reuse the previous values. (Note that there |
|
627 |
* have been cases where a relocation exists |
|
628 |
* against a copy relocation symbol, our ld(1) |
|
629 |
* should optimize this away, but make sure we |
|
630 |
* don't use the same symbol information should |
|
631 |
* this case exist). |
|
632 |
*/ |
|
633 |
if ((rsymndx == psymndx) && |
|
634 |
(rtype != R_386_COPY)) { |
|
635 |
/* LINTED */ |
|
636 |
if (psymdef == 0) { |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
637 |
DBG_CALL(Dbg_bind_weak(lmp, |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
638 |
(Addr)roffset, (Addr) |
0 | 639 |
(roffset - basebgn), name)); |
640 |
continue; |
|
641 |
} |
|
642 |
/* LINTED */ |
|
643 |
value = pvalue; |
|
644 |
/* LINTED */ |
|
645 |
name = pname; |
|
646 |
/* LINTED */ |
|
647 |
symdef = psymdef; |
|
648 |
/* LINTED */ |
|
649 |
symref = psymref; |
|
650 |
/* LINTED */ |
|
651 |
_lmp = plmp; |
|
652 |
/* LINTED */ |
|
653 |
binfo = pbinfo; |
|
654 |
||
655 |
if ((LIST(_lmp)->lm_tflags | |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
656 |
AFLAGS(_lmp)) & |
0 | 657 |
LML_TFLG_AUD_SYMBIND) { |
658 |
value = audit_symbind(lmp, _lmp, |
|
659 |
/* LINTED */ |
|
660 |
symdef, dsymndx, value, |
|
661 |
&sb_flags); |
|
662 |
} |
|
663 |
} else { |
|
664 |
Slookup sl; |
|
11827 | 665 |
Sresult sr; |
0 | 666 |
|
667 |
/* |
|
668 |
* Lookup the symbol definition. |
|
11827 | 669 |
* Initialize the symbol lookup, and |
670 |
* symbol result, data structures. |
|
0 | 671 |
*/ |
672 |
name = (char *)(STRTAB(lmp) + |
|
673 |
symref->st_name); |
|
674 |
||
5950 | 675 |
SLOOKUP_INIT(sl, name, lmp, 0, |
676 |
ld_entry_cnt, 0, rsymndx, symref, |
|
677 |
rtype, LKUP_STDRELOC); |
|
11827 | 678 |
SRESULT_INIT(sr, name); |
679 |
symdef = NULL; |
|
0 | 680 |
|
11827 | 681 |
if (lookup_sym(&sl, &sr, &binfo, |
682 |
in_nfavl)) { |
|
683 |
name = (char *)sr.sr_name; |
|
684 |
_lmp = sr.sr_dmap; |
|
685 |
symdef = sr.sr_sym; |
|
686 |
} |
|
0 | 687 |
|
688 |
/* |
|
689 |
* If the symbol is not found and the |
|
690 |
* reference was not to a weak symbol, |
|
691 |
* report an error. Weak references |
|
692 |
* may be unresolved. |
|
693 |
*/ |
|
4679 | 694 |
/* BEGIN CSTYLED */ |
0 | 695 |
if (symdef == 0) { |
6150 | 696 |
if (sl.sl_bind != STB_WEAK) { |
697 |
if (elf_reloc_error(lmp, name, |
|
698 |
rel, binfo)) |
|
699 |
continue; |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
700 |
|
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
701 |
ret = 0; |
6150 | 702 |
break; |
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
703 |
|
0 | 704 |
} else { |
705 |
psymndx = rsymndx; |
|
706 |
psymdef = 0; |
|
707 |
||
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
708 |
DBG_CALL(Dbg_bind_weak(lmp, |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
709 |
(Addr)roffset, (Addr) |
0 | 710 |
(roffset - basebgn), name)); |
711 |
continue; |
|
712 |
} |
|
713 |
} |
|
4679 | 714 |
/* END CSTYLED */ |
0 | 715 |
|
716 |
/* |
|
717 |
* If symbol was found in an object |
|
718 |
* other than the referencing object |
|
719 |
* then record the binding. |
|
720 |
*/ |
|
721 |
if ((lmp != _lmp) && ((FLAGS1(_lmp) & |
|
722 |
FL1_RT_NOINIFIN) == 0)) { |
|
5892
b863dde33f1b
6492726 Merge SHF_MERGE|SHF_STRINGS input sections
ab196087
parents:
5220
diff
changeset
|
723 |
if (aplist_test(&bound, _lmp, |
0 | 724 |
AL_CNT_RELBIND) == 0) { |
725 |
ret = 0; |
|
726 |
break; |
|
727 |
} |
|
728 |
} |
|
729 |
||
730 |
/* |
|
731 |
* Calculate the location of definition; |
|
732 |
* symbol value plus base address of |
|
733 |
* containing shared object. |
|
734 |
*/ |
|
2850 | 735 |
if (IS_SIZE(rtype)) |
736 |
value = symdef->st_size; |
|
737 |
else |
|
738 |
value = symdef->st_value; |
|
739 |
||
0 | 740 |
if (!(FLAGS(_lmp) & FLG_RT_FIXED) && |
2850 | 741 |
!(IS_SIZE(rtype)) && |
0 | 742 |
(symdef->st_shndx != SHN_ABS) && |
743 |
(ELF_ST_TYPE(symdef->st_info) != |
|
744 |
STT_TLS)) |
|
745 |
value += ADDR(_lmp); |
|
746 |
||
747 |
/* |
|
748 |
* Retain this symbol index and the |
|
749 |
* value in case it can be used for the |
|
750 |
* subsequent relocations. |
|
751 |
*/ |
|
752 |
if (rtype != R_386_COPY) { |
|
753 |
psymndx = rsymndx; |
|
754 |
pvalue = value; |
|
755 |
pname = name; |
|
756 |
psymdef = symdef; |
|
757 |
psymref = symref; |
|
758 |
plmp = _lmp; |
|
759 |
pbinfo = binfo; |
|
760 |
} |
|
761 |
if ((LIST(_lmp)->lm_tflags | |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
762 |
AFLAGS(_lmp)) & |
0 | 763 |
LML_TFLG_AUD_SYMBIND) { |
764 |
dsymndx = (((uintptr_t)symdef - |
|
765 |
(uintptr_t)SYMTAB(_lmp)) / |
|
766 |
SYMENT(_lmp)); |
|
767 |
value = audit_symbind(lmp, _lmp, |
|
768 |
symdef, dsymndx, value, |
|
769 |
&sb_flags); |
|
770 |
} |
|
771 |
} |
|
772 |
||
773 |
/* |
|
774 |
* If relocation is PC-relative, subtract |
|
775 |
* offset address. |
|
776 |
*/ |
|
777 |
if (IS_PC_RELATIVE(rtype)) |
|
778 |
value -= roffset; |
|
779 |
||
780 |
/* |
|
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
781 |
* Special case TLS relocations. |
0 | 782 |
*/ |
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
783 |
if (rtype == R_386_TLS_DTPMOD32) { |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
784 |
/* |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
785 |
* Relocation value is the TLS modid. |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
786 |
*/ |
0 | 787 |
value = TLSMODID(_lmp); |
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
788 |
|
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
789 |
} else if (rtype == R_386_TLS_TPOFF) { |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
790 |
if ((value = elf_static_tls(_lmp, |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
791 |
symdef, rel, rtype, name, roffset, |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
792 |
value)) == 0) { |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
793 |
ret = 0; |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
794 |
break; |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
795 |
} |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
796 |
} |
0 | 797 |
} |
798 |
} else { |
|
799 |
/* |
|
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
800 |
* Special cases. |
0 | 801 |
*/ |
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
802 |
if (rtype == R_386_TLS_DTPMOD32) { |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
803 |
/* |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
804 |
* TLS relocation value is the TLS modid. |
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
805 |
*/ |
0 | 806 |
value = TLSMODID(lmp); |
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
807 |
} else |
0 | 808 |
value = basebgn; |
11827 | 809 |
|
810 |
name = NULL; |
|
0 | 811 |
} |
812 |
||
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
813 |
DBG_CALL(Dbg_reloc_in(LIST(lmp), ELF_DBG_RTLD, M_MACH, |
9406
264141fcf761
6831285 linker LD_DEBUG support needs improvements
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents:
8598
diff
changeset
|
814 |
M_REL_SHT_TYPE, rel, NULL, 0, name)); |
2145
f3828f946507
6423051 static TLS support within the link-editors needs a major face lift
rie
parents:
1976
diff
changeset
|
815 |
|
0 | 816 |
/* |
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
817 |
* Make sure the segment is writable. |
0 | 818 |
*/ |
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
819 |
if (((mpp->mr_prot & PROT_WRITE) == 0) && |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
820 |
((set_prot(lmp, mpp, 1) == 0) || |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
821 |
(aplist_append(textrel, mpp, AL_CNT_TEXTREL) == NULL))) { |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
822 |
ret = 0; |
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
823 |
break; |
0 | 824 |
} |
825 |
||
826 |
/* |
|
827 |
* Call relocation routine to perform required relocation. |
|
828 |
*/ |
|
829 |
switch (rtype) { |
|
830 |
case R_386_COPY: |
|
831 |
if (elf_copy_reloc(name, symref, lmp, (void *)roffset, |
|
832 |
symdef, _lmp, (const void *)value) == 0) |
|
833 |
ret = 0; |
|
834 |
break; |
|
835 |
case R_386_JMP_SLOT: |
|
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
836 |
if (((LIST(lmp)->lm_tflags | AFLAGS(lmp)) & |
0 | 837 |
(LML_TFLG_AUD_PLTENTER | LML_TFLG_AUD_PLTEXIT)) && |
838 |
AUDINFO(lmp)->ai_dynplts) { |
|
839 |
int fail = 0; |
|
840 |
int pltndx = (((ulong_t)rel - |
|
4679 | 841 |
(uintptr_t)JMPREL(lmp)) / relsiz); |
0 | 842 |
int symndx = (((uintptr_t)symdef - |
4679 | 843 |
(uintptr_t)SYMTAB(_lmp)) / SYMENT(_lmp)); |
0 | 844 |
|
845 |
(void) elf_plt_trace_write(roffset, lmp, _lmp, |
|
846 |
symdef, symndx, pltndx, (caddr_t)value, |
|
847 |
sb_flags, &fail); |
|
848 |
if (fail) |
|
849 |
ret = 0; |
|
850 |
} else { |
|
851 |
/* |
|
852 |
* Write standard PLT entry to jump directly |
|
853 |
* to newly bound function. |
|
854 |
*/ |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
855 |
DBG_CALL(Dbg_reloc_apply_val(LIST(lmp), |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
856 |
ELF_DBG_RTLD, (Xword)roffset, |
0 | 857 |
(Xword)value)); |
858 |
*(ulong_t *)roffset = value; |
|
859 |
} |
|
860 |
break; |
|
861 |
default: |
|
862 |
/* |
|
863 |
* Write the relocation out. |
|
864 |
*/ |
|
5189
66a4f4f8a159
6610591 do_reloc() should not require unused arguments
ab196087
parents:
4947
diff
changeset
|
865 |
if (do_reloc_rtld(rtype, (uchar_t *)roffset, |
66a4f4f8a159
6610591 do_reloc() should not require unused arguments
ab196087
parents:
4947
diff
changeset
|
866 |
(Word *)&value, name, NAME(lmp), LIST(lmp)) == 0) |
0 | 867 |
ret = 0; |
868 |
||
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
869 |
DBG_CALL(Dbg_reloc_apply_val(LIST(lmp), ELF_DBG_RTLD, |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
870 |
(Xword)roffset, (Xword)value)); |
0 | 871 |
} |
872 |
||
873 |
if ((ret == 0) && |
|
874 |
((LIST(lmp)->lm_flags & LML_FLG_TRC_WARN) == 0)) |
|
875 |
break; |
|
876 |
||
877 |
if (binfo) { |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
878 |
DBG_CALL(Dbg_bind_global(lmp, (Addr)roffset, |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
879 |
(Off)(roffset - basebgn), (Xword)(-1), PLT_T_FULL, |
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
880 |
_lmp, (Addr)value, symdef->st_value, name, binfo)); |
0 | 881 |
} |
882 |
} |
|
883 |
||
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
884 |
return (relocate_finish(lmp, bound, ret)); |
0 | 885 |
} |
886 |
||
887 |
/* |
|
888 |
* Initialize the first few got entries so that function calls go to |
|
889 |
* elf_rtbndr: |
|
890 |
* |
|
891 |
* GOT[GOT_XLINKMAP] = the address of the link map |
|
892 |
* GOT[GOT_XRTLD] = the address of rtbinder |
|
893 |
*/ |
|
894 |
void |
|
895 |
elf_plt_init(void *got, caddr_t l) |
|
896 |
{ |
|
897 |
uint_t *_got; |
|
898 |
/* LINTED */ |
|
899 |
Rt_map *lmp = (Rt_map *)l; |
|
900 |
||
901 |
_got = (uint_t *)got + M_GOT_XLINKMAP; |
|
902 |
*_got = (uint_t)lmp; |
|
903 |
_got = (uint_t *)got + M_GOT_XRTLD; |
|
904 |
*_got = (uint_t)elf_rtbndr; |
|
905 |
} |
|
906 |
||
907 |
/* |
|
908 |
* For SVR4 Intel compatability. USL uses /usr/lib/libc.so.1 as the run-time |
|
909 |
* linker, so the interpreter's address will differ from /usr/lib/ld.so.1. |
|
910 |
* Further, USL has special _iob[] and _ctype[] processing that makes up for the |
|
911 |
* fact that these arrays do not have associated copy relocations. So we try |
|
912 |
* and make up for that here. Any relocations found will be added to the global |
|
913 |
* copy relocation list and will be processed in setup(). |
|
914 |
*/ |
|
915 |
static int |
|
916 |
_elf_copy_reloc(const char *name, Rt_map *rlmp, Rt_map *dlmp) |
|
917 |
{ |
|
918 |
Sym *symref, *symdef; |
|
919 |
caddr_t ref, def; |
|
920 |
Rt_map *_lmp; |
|
921 |
Rel rel; |
|
922 |
Slookup sl; |
|
11827 | 923 |
Sresult sr; |
0 | 924 |
uint_t binfo; |
925 |
||
926 |
/* |
|
927 |
* Determine if the special symbol exists as a reference in the dynamic |
|
928 |
* executable, and that an associated definition exists in libc.so.1. |
|
5950 | 929 |
* |
11827 | 930 |
* Initialize the symbol lookup, and symbol result, data structures. |
0 | 931 |
*/ |
5950 | 932 |
SLOOKUP_INIT(sl, name, rlmp, rlmp, ld_entry_cnt, 0, 0, 0, 0, |
933 |
LKUP_FIRST); |
|
11827 | 934 |
SRESULT_INIT(sr, name); |
0 | 935 |
|
11827 | 936 |
if (lookup_sym(&sl, &sr, &binfo, NULL) == 0) |
937 |
return (1); |
|
938 |
symref = sr.sr_sym; |
|
939 |
||
940 |
SLOOKUP_INIT(sl, name, rlmp, dlmp, ld_entry_cnt, 0, 0, 0, 0, |
|
941 |
LKUP_DEFT); |
|
942 |
SRESULT_INIT(sr, name); |
|
943 |
||
944 |
if (lookup_sym(&sl, &sr, &binfo, NULL) == 0) |
|
0 | 945 |
return (1); |
946 |
||
11827 | 947 |
_lmp = sr.sr_dmap; |
948 |
symdef = sr.sr_sym; |
|
0 | 949 |
|
11827 | 950 |
if (strcmp(NAME(sr.sr_dmap), MSG_ORIG(MSG_PTH_LIBC))) |
0 | 951 |
return (1); |
952 |
||
953 |
/* |
|
954 |
* Determine the reference and definition addresses. |
|
955 |
*/ |
|
956 |
ref = (void *)(symref->st_value); |
|
957 |
if (!(FLAGS(rlmp) & FLG_RT_FIXED)) |
|
958 |
ref += ADDR(rlmp); |
|
959 |
def = (void *)(symdef->st_value); |
|
11827 | 960 |
if (!(FLAGS(sr.sr_dmap) & FLG_RT_FIXED)) |
0 | 961 |
def += ADDR(_lmp); |
962 |
||
963 |
/* |
|
964 |
* Set up a relocation entry for debugging and call the generic copy |
|
965 |
* relocation function to provide symbol size error checking and to |
|
966 |
* record the copy relocation that must be performed. |
|
967 |
*/ |
|
968 |
rel.r_offset = (Addr)ref; |
|
969 |
rel.r_info = (Word)R_386_COPY; |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
970 |
DBG_CALL(Dbg_reloc_in(LIST(rlmp), ELF_DBG_RTLD, M_MACH, M_REL_SHT_TYPE, |
9406
264141fcf761
6831285 linker LD_DEBUG support needs improvements
Ali Bahrami <Ali.Bahrami@Sun.COM>
parents:
8598
diff
changeset
|
971 |
&rel, NULL, 0, name)); |
0 | 972 |
|
973 |
return (elf_copy_reloc((char *)name, symref, rlmp, (void *)ref, symdef, |
|
974 |
_lmp, (void *)def)); |
|
975 |
} |
|
976 |
||
977 |
int |
|
978 |
elf_copy_gen(Rt_map *lmp) |
|
979 |
{ |
|
980 |
if (interp && ((ulong_t)interp->i_faddr != |
|
981 |
r_debug.rtd_rdebug.r_ldbase) && |
|
982 |
!(strcmp(interp->i_name, MSG_ORIG(MSG_PTH_LIBC)))) { |
|
983 |
||
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
984 |
DBG_CALL(Dbg_reloc_run(lmp, M_REL_SHT_TYPE, 0, |
0 | 985 |
DBG_REL_START)); |
986 |
||
987 |
if (_elf_copy_reloc(MSG_ORIG(MSG_SYM_CTYPE), lmp, |
|
988 |
(Rt_map *)NEXT(lmp)) == 0) |
|
989 |
return (0); |
|
990 |
if (_elf_copy_reloc(MSG_ORIG(MSG_SYM_IOB), lmp, |
|
991 |
(Rt_map *)NEXT(lmp)) == 0) |
|
992 |
return (0); |
|
993 |
} |
|
994 |
return (1); |
|
995 |
} |
|
996 |
||
997 |
/* |
|
998 |
* Plt writing interface to allow debugging initialization to be generic. |
|
999 |
*/ |
|
1000 |
Pltbindtype |
|
1001 |
/* ARGSUSED1 */ |
|
1002 |
elf_plt_write(uintptr_t addr, uintptr_t vaddr, void *rptr, uintptr_t symval, |
|
1003 |
Xword pltndx) |
|
1004 |
{ |
|
1005 |
Rel *rel = (Rel*)rptr; |
|
1006 |
uintptr_t pltaddr; |
|
1007 |
||
1008 |
pltaddr = addr + rel->r_offset; |
|
1009 |
*(ulong_t *)pltaddr = (ulong_t)symval; |
|
1010 |
DBG_CALL(pltcntfull++); |
|
1011 |
return (PLT_T_FULL); |
|
1012 |
} |
|
1013 |
||
1014 |
/* |
|
1015 |
* Provide a machine specific interface to the conversion routine. By calling |
|
1016 |
* the machine specific version, rather than the generic version, we insure that |
|
1017 |
* the data tables/strings for all known machine versions aren't dragged into |
|
1018 |
* ld.so.1. |
|
1019 |
*/ |
|
1020 |
const char * |
|
1618
8c9a4f31d225
6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents:
546
diff
changeset
|
1021 |
_conv_reloc_type(uint_t rel) |
0 | 1022 |
{ |
8598
0867fc633d66
6686372 ld.so.1 should use mmapobj(2)
Rod Evans <Rod.Evans@Sun.COM>
parents:
6812
diff
changeset
|
1023 |
static Conv_inv_buf_t inv_buf; |
4734
a4708faa3e85
6583742 ELF string conversion library needs to lose static writable buffers
ab196087
parents:
4679
diff
changeset
|
1024 |
|
a4708faa3e85
6583742 ELF string conversion library needs to lose static writable buffers
ab196087
parents:
4679
diff
changeset
|
1025 |
return (conv_reloc_386_type(rel, 0, &inv_buf)); |
0 | 1026 |
} |