Lines Matching refs:obj
181 * _rtld_relocate_relr(obj)
183 * Relocate the RELR entries of obj. The RELR table is encoded as
196 * Each address A is taken relative to obj->relocbase, and has
197 * obj->relocbase added to the Elf_Addr it points at. For each
204 * (again, relative to obj->relocbase) has obj->relocbase added
219 _rtld_relocate_relr(Obj_Entry *obj)
223 if (obj->relr == obj->relrlim)
226 for (relr = obj->relr; relr < obj->relrlim;) {
233 where = (Elf_Addr *)(obj->relocbase + *relr);
234 *where++ += (Elf_Addr)obj->relocbase;
239 while (++relr < obj->relrlim && *relr & 1) {
250 *where += (Elf_Addr)obj->relocbase;
265 Obj_Entry *obj;
268 for (obj = first; obj != NULL; obj = obj->next) {
269 if ((!obj->sysv_hash && !obj->gnu_hash) ||
270 obj->symtab == NULL || obj->strtab == NULL) {
272 " symbol table", obj->path);
275 if (obj->nbuckets == UINT32_MAX) {
276 _rtld_error("%s: Symbol table too large", obj->path);
280 obj->path,
281 (long)(obj->rellim - obj->rel),
282 (long)(obj->relalim - obj->rela),
283 (long)(obj->pltrellim - obj->pltrel),
284 (long)(obj->pltrelalim - obj->pltrela)));
286 if (obj->textrel) {
287 xwarnx("%s: text relocations", obj->path);
292 if (mprotect(obj->mapbase, obj->textsize,
295 "segment: %s", obj->path, xstrerror(errno));
300 _rtld_relocate_relr(obj);
302 if (_rtld_relocate_nonplt_objects(obj) < 0)
304 if (obj->textrel) { /* Re-protected the text segment. */
305 if (mprotect(obj->mapbase, obj->textsize,
308 "segment: %s", obj->path, xstrerror(errno));
313 if (_rtld_relocate_plt_lazy(obj) < 0)
315 if (obj->z_now || bind_now) {
317 if (_rtld_relocate_plt_objects(obj) < 0)
325 if (obj->pltgot != NULL)
326 _rtld_setup_pltgot(obj);
328 if (_rtld_relro(obj, false) == -1)
336 _rtld_resolve_ifunc(const Obj_Entry *obj, const Elf_Sym *def)
341 target = _rtld_resolve_ifunc2(obj,
342 (Elf_Addr)obj->relocbase + def->st_value);
348 _rtld_resolve_ifunc2(const Obj_Entry *obj, Elf_Addr addr)
352 target = _rtld_call_function_addr(obj, addr);
362 _rtld_call_ifunc(Obj_Entry *obj, sigset_t *mask, u_int cur_objgen)
373 _rtld_call_ifunc(Obj_Entry *obj, sigset_t *mask, u_int cur_objgen)
382 while (obj->ifunc_remaining > 0 && _rtld_objgen == cur_objgen) {
383 rela = obj->pltrelalim - obj->ifunc_remaining--;
392 where2 = (Elf_Word *)(obj->relocbase + rela->r_offset);
394 where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
396 target = (Elf_Addr)(obj->relocbase + rela->r_addend);
398 target = _rtld_resolve_ifunc2(obj, target);
408 while (obj->ifunc_remaining_nonplt > 0 && _rtld_objgen == cur_objgen) {
409 rela = obj->relalim - obj->ifunc_remaining_nonplt--;
412 where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
413 target = (Elf_Addr)(obj->relocbase + rela->r_addend);
415 target = _rtld_resolve_ifunc2(obj, target);
425 _rtld_call_ifunc(Obj_Entry *obj, sigset_t *mask, u_int cur_objgen)
430 while (obj->ifunc_remaining > 0 && _rtld_objgen == cur_objgen) {
431 rel = obj->pltrellim - obj->ifunc_remaining;
432 --obj->ifunc_remaining;
434 where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
436 target = _rtld_resolve_ifunc2(obj, *where);
443 while (obj->ifunc_remaining_nonplt > 0 && _rtld_objgen == cur_objgen) {
444 rel = obj->rellim - obj->ifunc_remaining_nonplt--;
446 where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
448 target = _rtld_resolve_ifunc2(obj, *where);