FreeBSD/libexec/rtld-elf/arm/reloc.c
/*
 *  * LD_BIND_NOW was set - force relocation for all jump slots
 *   */
LD_BIND_NOW was set - force relocation for all jump slots
LD_BIND_NOW was set - force relocation for all jump slots
int
reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate)
{
	const Obj_Entry *defobj;
	const Elf_Rel *rellim;
	const Elf_Rel *rel;
	const Elf_Sym *def;
	Elf_Addr *where;
	Elf_Addr target;
	rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize);
	for (rel = obj->pltrel; rel < rellim; rel++) {
		assert(ELF_R_TYPE(rel->r_info) == R_ARM_JUMP_SLOT);
		where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
		def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj,
		    SYMLOOK_IN_PLT | flags, NULL, lockstate);
		if (def == NULL) {
			dbg("reloc_jmpslots: sym not found");
			return (-1);
		}
		target = (Elf_Addr)(defobj->relocbase + def->st_value);		
		reloc_jmpslot(where, target, defobj, obj,
		    (const Elf_Rel *) rel);
	}
	obj->jmpslots_done = true;
	return (0);
}
int reloc_jmpslots ( Obj_Entry * obj , int flags , RtldLockState * lockstate ) { const Obj_Entry * defobj ; const Elf_Rel * rellim ; const Elf_Rel * rel ; const Elf_Sym * def ; Elf_Addr * where ; Elf_Addr target ; rellim = ( const Elf_Rel * ) ( ( char * ) obj -> pltrel + obj -> pltrelsize ) ; for ( rel = obj -> pltrel ; rel < rellim ; rel ++ ) { assert ( ELF_R_TYPE ( rel -> r_info ) == R_ARM_JUMP_SLOT ) ; where = ( Elf_Addr * ) ( obj -> relocbase + rel -> r_offset ) ; def = find_symdef ( ELF_R_SYM ( rel -> r_info ) , obj , & defobj , SYMLOOK_IN_PLT | flags , NULL , lockstate ) ; if ( def == NULL ) { dbg ( " " ) ; return ( -1 ) ; } target = ( Elf_Addr ) ( defobj -> relocbase + def -> st_value ) ; reloc_jmpslot ( where , target , defobj , obj , ( const Elf_Rel * ) rel ) ; } obj -> jmpslots_done = true ; return ( 0 ) ; }
* LD_BIND_NOW was set - force relocation for all jump slots
* LD_BIND_NOW was set - force relocation for all jump slots