FreeBSD/libexec/rtld-elf/rtld.c
/*
 * The handling of R_MACHINE_IRELATIVE relocations and jumpslots
 * referencing STT_GNU_IFUNC symbols is postponed till the other
 * relocations are done.  The indirect functions specified as
 * ifunc are allowed to call other symbols, so we need to have
 * objects relocated before asking for resolution from indirects.
 *
 * The R_MACHINE_IRELATIVE slots are resolved in greedy fashion,
 * instead of the usual lazy handling of PLT slots.  It is
 * consistent with how GNU does it.
 */
The handling of R_MACHINE_IRELATIVE relocations and jumpslots
referencing STT_GNU_IFUNC symbols is postponed till the other
relocations are done.  The indirect functions specified as
ifunc are allowed to call other symbols, so we need to have
objects relocated before asking for resolution from indirects.

The R_MACHINE_IRELATIVE slots are resolved in greedy fashion,
instead of the usual lazy handling of PLT slots.  It is
consistent with how GNU does it.
The handling of R_MACHINE_IRELATIVE relocations and jumpslots referencing STT_GNU_IFUNC symbols is postponed till the other relocations are done . The indirect functions specified as ifunc are allowed to call other symbols so we need to have objects relocated before asking for resolution from indirects . The R_MACHINE_IRELATIVE slots are resolved in greedy fashion instead of the usual lazy handling of PLT slots . It is consistent with how GNU does it .
static int
resolve_object_ifunc(Obj_Entry *obj, bool bind_now, int flags,
    RtldLockState *lockstate)
{
	if (obj->irelative && reloc_iresolve(obj, lockstate) == -1)
		return (-1);
	if ((obj->bind_now || bind_now) && obj->gnu_ifunc &&
	    reloc_gnu_ifunc(obj, flags, lockstate) == -1)
		return (-1);
	return (0);
}
static int resolve_object_ifunc ( Obj_Entry * obj , bool bind_now , int flags , RtldLockState * lockstate ) { if ( obj -> irelative && reloc_iresolve ( obj , lockstate ) == -1 ) return ( -1 ) ; if ( ( obj -> bind_now || bind_now ) && obj -> gnu_ifunc && reloc_gnu_ifunc ( obj , flags , lockstate ) == -1 ) return ( -1 ) ; return ( 0 ) ; }
The handling of R_MACHINE_IRELATIVE relocations and jumpslots
 referencing STT_GNU_IFUNC symbols is postponed till the other
 relocations are done.
The handling of R_MACHINE_IRELATIVE relocations and jumpslots referencing STT_GNU_IFUNC symbols is postponed till the other relocations are done .