if (_dl_name_match_p (_dl_profile, l)) _dl_profile_map = l;
if (_dl_name_match_p (GL(dl_profile), l)) GL(dl_profile_map) = l;
elf_machine_runtime_setup (struct link_map *l, int lazy, int profile){  if (l->l_info[DT_JMPREL] && lazy)    {      extern void _dl_runtime_resolve_0 (void);      extern void _dl_runtime_resolve_1 (void);      extern void _dl_runtime_profile_0 (void);      extern void _dl_runtime_profile_1 (void);      Elf64_Addr res0_addr, res1_addr;      unsigned int *plt = (void *) D_PTR (l, l_info[DT_PLTGOT]);      int i = 0;      if (! profile)	{	  res0_addr = (Elf64_Addr) &_dl_runtime_resolve_0;	  res1_addr = (Elf64_Addr) &_dl_runtime_resolve_1;	}      else	{	  res0_addr = (Elf64_Addr) &_dl_runtime_profile_0;	  res1_addr = (Elf64_Addr) &_dl_runtime_profile_1;	  if (_dl_name_match_p (_dl_profile, l))	    _dl_profile_map = l;	}      /* PLT0 looks like:	 save	%sp, -192, %sp	 sethi	%hh(_dl_runtime_{resolve,profile}_0), %l0	 sethi	%lm(_dl_runtime_{resolve,profile}_0), %l1	 or	%l0, %hm(_dl_runtime_{resolve,profile}_0), %l0	 or	%l1, %lo(_dl_runtime_{resolve,profile}_0), %l1	 sllx	%l0, 32, %l0	 jmpl	%l0 + %l1, %l6	  sethi	%hi(0xffc00), %l2       */      plt[0] = 0x9de3bf40;      plt[1] = 0x21000000 | (res0_addr >> (64 - 22));      plt[2] = 0x23000000 | ((res0_addr >> 10) & 0x003fffff);      plt[3] = 0xa0142000 | ((res0_addr >> 32) & 0x3ff);      plt[4] = 0xa2146000 | (res0_addr & 0x3ff);      plt[5] = 0xa12c3020;      plt[6] = 0xadc40011;      plt[7] = 0x250003ff;      /* PLT1 looks like:	 save	%sp, -192, %sp	 sethi	%hh(_dl_runtime_{resolve,profile}_1), %l0	 sethi	%lm(_dl_runtime_{resolve,profile}_1), %l1	 or	%l0, %hm(_dl_runtime_{resolve,profile}_1), %l0	 or	%l1, %lo(_dl_runtime_{resolve,profile}_1), %l1	 sllx	%l0, 32, %l0	 jmpl	%l0 + %l1, %l6	  srlx	%g1, 12, %o1       */      plt[8 + 0] = 0x9de3bf40;      if (__builtin_expect (((res1_addr + 4) >> 32) & 0x3ff, 0))	i = 1;      else	res1_addr += 4;      plt[8 + 1] = 0x21000000 | (res1_addr >> (64 - 22));      plt[8 + 2] = 0x23000000 | ((res1_addr >> 10) & 0x003fffff);      if (__builtin_expect (i, 0))	plt[8 + 3] = 0xa0142000 | ((res1_addr >> 32) & 0x3ff);      else	plt[8 + 3] = 0xa12c3020;      plt[8 + 4] = 0xa2146000 | (res1_addr & 0x3ff);      if (__builtin_expect (i, 0))	plt[8 + 5] = 0xa12c3020;      plt[8 + 5 + i] = 0xadc40011;      plt[8 + 6 + i] = 0x9330700c;      /* Now put the magic cookie at the beginning of .PLT2	 Entry .PLT3 is unused by this implementation.  */      *((struct link_map **)(&plt[16 + 0])) = l;      if (__builtin_expect (l->l_info[VALIDX(DT_GNU_PRELINKED)] != NULL, 0)	  || __builtin_expect (l->l_info [VALIDX (DT_GNU_LIBLISTSZ)] != NULL, 0))	{	  /* Need to reinitialize .plt to undo prelinking.  */	  Elf64_Rela *rela = (Elf64_Rela *) D_PTR (l, l_info[DT_JMPREL]);	  Elf64_Rela *relaend	    = (Elf64_Rela *) ((char *) rela			      + l->l_info[DT_PLTRELSZ]->d_un.d_val);	  /* prelink must ensure there are no R_SPARC_NONE relocs left	     in .rela.plt.  */	  while (rela < relaend)	    {	      if (__builtin_expect (rela->r_addend, 0) != 0)		{                  Elf64_Addr slot = ((rela->r_offset + 0x400				      - (Elf64_Addr) plt)				     / 0x1400) * 0x1400				    + (Elf64_Addr) plt - 0x400;		  /* ldx [%o7 + X], %g1  */		  unsigned int first_ldx = *(unsigned int *)(slot + 12);		  Elf64_Addr ptr = slot + (first_ldx & 0xfff) + 4;		  *(Elf64_Addr *) rela->r_offset		    = (Elf64_Addr) plt		      - (slot + ((rela->r_offset - ptr) / 8) * 24 + 4);		  ++rela;		  continue;		}	      *(unsigned int *) rela->r_offset		= 0x03000000 | (rela->r_offset - (Elf64_Addr) plt);	      *(unsigned int *) (rela->r_offset + 4)		= 0x30680000 | ((((Elf64_Addr) plt + 32				  - rela->r_offset - 4) >> 2) & 0x7ffff);	      __asm __volatile ("flush %0" : : "r" (rela->r_offset));	      __asm __volatile ("flush %0+4" : : "r" (rela->r_offset));	      ++rela;	    }	}    }  return lazy;}