how can i convert an elf format file produced by gcc into a coff file for linking? objcopy seems not to be capable of doing it, says
root@hyperspace:~# objcopy -O elf gcctest.o
objcopy: stsq3ZwK: Invalid bfd target
elf to coff conversion
Re:elf to coff conversion
objcopy needs to know what ELF is, objcopy --help should make it list what formats it knows. ELF isnt one of them. you need to get/compile binutils to know about elf, coff, etc.
-- Stu --
Re:elf to coff conversion
ok, how do i then compile coff support into objcopy? i genrally dont know C that much, i like assembly instead
Re:elf to coff conversion
Most versions of binutils do support ELF, although DJGPP doesn't. Run objcopy (no parameters) and look at the bottom line.
For example, Cygwin says:
Here, valid ELF targets are elf32-i386, elf32-little and elf32-big. elf on its own (as you wrote) isn't valid.
BTW: are you sure gcc is outputting ELF? If your version of gcc outputs ELF, your version of ld will support ELF.
For example, Cygwin says:
Code: Select all
objcopy: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec symbolsrec tekhex binary ihex
BTW: are you sure gcc is outputting ELF? If your version of gcc outputs ELF, your version of ld will support ELF.