Fix function replacement on ARM