Fixes PR42171.
In GNU objcopy, if -O (--output-target) is not specified, the value is
copied from -I (--input-target).
objcopy -I binary -B i386:x86-64 a.txt b # b is copied from a.txt llvm-objcopy -I binary -B i386:x86-64 a.txt b # b is an x86-64 object file
This patch changes our behavior to match GNU. GNU objcopy has another
strange behavior:
objcopy -I binary -O elf64-x86-64 a.txt b.o # e_machine is EM_NONE objcopy -I binary -B i386:x86-64 -O elf64-x86-64 a.txt b.o # e_machine is EM_X86_64
It is documented that -B is not used unless -I binary. Then, it is
unclear why the e_machine field cannot be inferred from -O. We just
fill in the e_machine field regardless of -B.