Hi, HEAD of ld/binutils ignores -b binary: $ ld -m elf_x86_64 -r --oformat elf64-x86-64 -o foo.o -b binary foo.txt ld: foo.txt: not in ELF format $ ld --version GNU ld (GNU Binutils) 2.27.51.20161215 Instead, in previous versions it works: $ ld -m elf_x86_64 -r --oformat elf64-x86-64 -o foo.o -b binary foo.txt $ file foo.o foo.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a961cdd5f139d3c3e09170db52bd8df7dafae13f commit a961cdd5f139d3c3e09170db52bd8df7dafae13f Author: Alan Modra <amodra@gmail.com> Date: Thu Dec 15 21:29:44 2016 +1030 Linking non-ELF file broken by PR20908 fix PR ld/20968 PR ld/20908 * elflink.c (bfd_elf_final_link): Revert 2016-12-02 change. Move reloc counting code later after ELF flavour test.
fixed
Thanks! (And confirmed.)