FreeBSD/libexec/rtld-elf/powerpc64/reloc.c
/*
 * Initialise a PLT slot to the resolving trampoline
 */
Initialise a PLT slot to the resolving trampoline
Initialise a PLT slot to the resolving trampoline
static int
reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela)
{
	Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
	long reloff;
	reloff = rela - obj->pltrela;
	dbg(" reloc_plt_object: where=%p,reloff=%lx,glink=%#lx", (void *)where,
	    reloff, obj->glink);
#if !defined(_CALL_ELF) || _CALL_ELF == 1
	*where = (Elf_Addr)obj->glink + 32 + 
	    8*((reloff < 0x8000) ? reloff : 0x8000) + 
	    12*((reloff < 0x8000) ? 0 : (reloff - 0x8000));
#else
	*where = (Elf_Addr)obj->glink + 4*reloff + 32;
#endif
	return (0);
}
static int reloc_plt_object ( Obj_Entry * obj , const Elf_Rela * rela ) { Elf_Addr * where = ( Elf_Addr * ) ( obj -> relocbase + rela -> r_offset ) ; long reloff ; reloff = rela - obj -> pltrela ; dbg ( " " , ( void * ) where , reloff , obj -> glink ) ; #if ! defined ( _CALL_ELF ) || _CALL_ELF == 1 * where = ( Elf_Addr ) obj -> glink + 32 + 8 * ( ( reloff < 0x8000 ) ? reloff : 0x8000 ) + 12 * ( ( reloff < 0x8000 ) ? 0 : ( reloff - 0x8000 ) ) ; #else * where = ( Elf_Addr ) obj -> glink + 4 * reloff + 32 ; #endif return ( 0 ) ; }
Initialise a PLT slot to the resolving trampoline
Initialise a PLT slot to the resolving trampoline
/* Glink code is 3 instructions after the first 32k, 2 before */