FreeBSD/libexec/rtld-elf/powerpc/reloc.c
/*
 * Perform early relocation of the run-time linker image
 */
Perform early relocation of the run-time linker image
Perform early relocation of the run - time linker image
void
reloc_non_plt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
{
	const Elf_Rela *rela = NULL, *relalim;
	Elf_Addr relasz = 0;
	Elf_Addr *where;
	for (; dynp->d_tag != DT_NULL; dynp++) {
		switch (dynp->d_tag) {
		case DT_RELA:
			rela = (const Elf_Rela *)(relocbase+dynp->d_un.d_ptr);
			break;
		case DT_RELASZ:
			relasz = dynp->d_un.d_val;
			break;
		}
	}
	relalim = (const Elf_Rela *)((caddr_t)rela + relasz);
	for (; rela < relalim; rela++) {
		where = (Elf_Addr *)(relocbase + rela->r_offset);
		*where = (Elf_Addr)(relocbase + rela->r_addend);
	}
}
void reloc_non_plt_self ( Elf_Dyn * dynp , Elf_Addr relocbase ) { const Elf_Rela * rela = NULL , * relalim ; Elf_Addr relasz = 0 ; Elf_Addr * where ; for ( ; dynp -> d_tag != DT_NULL ; dynp ++ ) { switch ( dynp -> d_tag ) { case DT_RELA : rela = ( const Elf_Rela * ) ( relocbase + dynp -> d_un . d_ptr ) ; break ; case DT_RELASZ : relasz = dynp -> d_un . d_val ; break ; } } relalim = ( const Elf_Rela * ) ( ( caddr_t ) rela + relasz ) ; for ( ; rela < relalim ; rela ++ ) { where = ( Elf_Addr * ) ( relocbase + rela -> r_offset ) ; * where = ( Elf_Addr ) ( relocbase + rela -> r_addend ) ; } }
Perform early relocation of the run-time linker image
Perform early relocation of the run - time linker image
/*
	 * Extract the rela/relasz values from the dynamic section
	 */ /*
	 * Relocate these values
	 */