Move some relocation functions to the CPP.