ld problems on win32

DJ Delorie dj@delorie.com
Mon Jul 9 16:44:00 GMT 2001


Yup, it works that way.  The --oformat option does override the
builtins, but your problem is that the linker just can't convert from
PE to ELF like that.  If you're targetting a different system, you should
build a cross-compiler and cross-linker, which would produce ELF objects
and there would be no conversion.

The reason it breaks is because there's a lot of PE-specific
information that's stored in the objects and binaries, and ld needs to
preserve that somehow.  It can't if the format changes, and the PE
backend (at least, for your linker) isn't smart enough to see if the
output file isn't PE.

>   Supported emulations:
>    i386pe

Does you linker even *support* ELF format?  Try "ld --help" and see if
ELF is listed.



More information about the Binutils mailing list