First cut at the actual relinking code