Lines Matching refs:obj
89 size_t _rtld_tls_dtv_generation = 1; /* Bumped on each load of obj w/ TLS */
110 * | obj 1 tls ptr | 1 TLS pointer for obj w/ obj->tlsindex 1
112 * | obj 2 tls ptr | 2 TLS pointer for obj w/ obj->tlsindex 2
118 * The values of obj->tlsindex start at 1; this way,
119 * dtv[obj->tlsindex] works, when dtv[0] is the generation. The
151 * TLS space if needed for the object obj with obj->tlsindex idx,
152 * at offset, which must be below obj->tlssize.
256 Obj_Entry *obj;
282 for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {
283 if (obj->tls_static) {
285 q = p + obj->tlsoffset;
287 q = p - obj->tlsoffset;
291 obj->path, _lwp_self(),
292 q, q + obj->tlsinitsize, obj->tlsindex,
293 obj->tlsoffset, obj->tlsalign, obj->tlsinit,
294 ALIGNED_P(q, obj->tlsalign) ? "" :
296 if (obj->tlsinitsize)
297 memcpy(q, obj->tlsinit, obj->tlsinitsize);
298 tcb->tcb_dtv[obj->tlsindex] = q;
366 * (thread control block) for the object obj whose obj->tlsindex
369 * If obj has had space in static TLS reserved (obj->tls_static),
371 * mark obj as having a TLS block allocated (obj->tls_dynamic),
380 Obj_Entry *obj;
383 for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {
384 if (obj->tlsindex == idx)
387 if (obj == NULL) {
391 if (obj->tls_static) {
393 p = (uint8_t *)tcb + obj->tlsoffset + sizeof(struct tls_tcb);
395 p = (uint8_t *)tcb - obj->tlsoffset;
400 p = xmalloc_aligned(obj->tlssize, obj->tlsalign, 0);
401 memcpy(p, obj->tlsinit, obj->tlsinitsize);
402 memset(p + obj->tlsinitsize, 0, obj->tlssize - obj->tlsinitsize);
404 obj->tls_dynamic = 1;
410 * _rtld_tls_offset_allocate(obj)
412 * Allocate a static thread-local storage offset for obj.
420 _rtld_tls_offset_allocate(Obj_Entry *obj)
424 if (obj->tls_dynamic)
427 if (obj->tls_static)
430 if (obj->tlssize == 0) {
431 obj->tlsoffset = 0;
432 obj->tls_static = 1;
437 offset = roundup2(_rtld_tls_static_offset, obj->tlsalign);
438 next_offset = offset + obj->tlssize;
441 offset = roundup2(_rtld_tls_static_offset + obj->tlssize,
442 obj->tlsalign);
454 if (obj->tlsinitsize) {
458 obj->path);
464 obj->path);
468 if (obj->tlsalign > _rtld_tls_static_max_align) {
469 _rtld_tls_static_max_align = obj->tlsalign;
471 obj->tlsoffset = offset;
473 obj->path, obj->tlsoffset, obj->tlssize, obj->tlsalign,
476 obj->tls_static = 1;
482 * _rtld_tls_offset_free(obj)
484 * Free a static thread-local storage offset for obj.
493 _rtld_tls_offset_free(Obj_Entry *obj)
499 obj->tls_static = 0;
523 * ti_module, i.e., arg[0], is the obj->tlsindex assigned at