Using objcopy can result in file permission changes. We work around this by using "cat" to copy the temporary output file into the target. Extract this code into a utility function. Signed-off-by: Allan McRae <allan@archlinux.org>