https://sourceware.org/bugzilla/show_bug.cgi?id=19197
--- Comment #6 from Markus Trippelsdorf <markus at trippelsdorf dot de> --- (In reply to H.J. Lu from comment #5) > (In reply to Markus Trippelsdorf from comment #2) > > markus@x4 linux % cat foo.c > > void foo () {}; > > > > markus@x4 linux % cat setup.ld > > OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") > > OUTPUT_ARCH(i386) > > > > markus@x4 linux % ld.bfd -m elf_x86_64 -T setup.ld foo.o > > What does "readelf -h a.out" say here? The linker script overwrites the -m argument with ld.bfd: ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 ... > > markus@x4 linux % ld.gold -m elf_x86_64 -T setup.ld foo.o > > ld: error: input file is incompatible with elf_x86_64 output emulation > > What if you remove "-m elf_x86_64" here for both ld.gold and ld.bfd? Well, of course this works. But I didn't make up this example, I took it from the Linux kernel. And I agree that it is bizarre to specify -m elf_x86_64 and then use OUTPUT_ARCH(i386) in the linker script. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils