tags:

views:

229

answers:

2

Hi, I am trying to do a simulate with Simcore Alpha/Functional Simulator and I need to create an image file but it is giving an error like "This is not Coff Executable" how can I create an Executable Coff file from a C source in linux?

A: 

Linux executable format is called ELF. COFF is a common file format for object modules, which are linked to make an ELF file or an EXE file

In your case if you have access to gcc, you can try

gcc mysource.c -o myprogram

toto
vadmin@vadmin:~/Desktop/SimCore-Loader-1.3$ gcc thread.c -o thread -lpthreadvadmin@vadmin:~/Desktop/SimCore-Loader-1.3$ lsabc COPYING main.cc Makefile memory.o thread thread.oasd define.h main.o memory.cc SimCore-Loader thread.cvadmin@vadmin:~/Desktop/SimCore-Loader-1.3$ ./SimCore-Loader threadSimCore-Loader Version 1.3 2003-11-05hdr.f_magic: 17791,thread : This is not coff executable.Usage: SimCore-Loader [option] executable args -s: use a 4-byte format instead of 8-byte. -f[filiname]: specify the output filename. input executable must be alpha COFF format.
ZipPy
It is giving error like that, what is alpha COFF format or coff executable
ZipPy
+3  A: 

In order to do this, you'll need a cross compiling gcc that is built to output COFF files. You may need to build gcc yourself if you can't find a pre-built one.

After you download gcc, you will need to configure it. The important option is --target; so if you want to target an Alpha architecture you would do:

configure --target=alpha-coff

I would also recommend you add a prefix to the binaries and install them into a different directory so you have no problems with the compiler interacting with the system compiler:

configure --target=alpha-coff --prefix=/opt/cross-gcc --program-prefix=coff-

(this will create coff-gcc in /opt/cross-gcc/bin, you can tweak those if want something different).

R Samuel Klatchko
He wants to target an alpha architecture, not i386. But otherwise you're guiding him down the correct path -- to a cross-compiler.
Ben Voigt
@Ben - thanks, I was focusing on the COFF issue and missed the mention about Alpha. Answer has been updated.
R Samuel Klatchko