is it possible to add a "format ELF" which automatically does what the "elf.ash" does?

BTW, just saw you even use the Linux UPX version for compressing FASM ;)
Posted on 2002-08-05 08:10:35 by bazik
Another thing:

Is there a FASM equvivalent to NASM's "GLOBAL" and "EXTERN" statements?
If not, do I have a chance to get them added? :)

Posted on 2002-08-05 08:36:05 by bazik
Yes, there is "extrn" statement (like in TASM) for the COFF output format, it's documented here.
Posted on 2002-08-06 13:23:24 by Tomasz Grysztar
thanks for pointing me to your docs again :)

I get a clean compile with FASM now! But neither GCC nor the Linker recognizes the file format :/

Here is some info:

bazik@antares coding $ gcc --version
gcc (GCC) 3.1.1
bazik@antares coding $ ld --version
GNU ld version 20020423
bazik@antares coding $ fasm
flat assembler version 1.39
usage: fasm source output

And here the commands I use:

bazik@antares coding $ fasm GtkTest.asm GtkTest.o
flat assembler version 1.39
2 passes, 932 bytes.
bazik@antares coding $ gcc `gtk-config --cflags --libs` -Wall -s -o GtkTest GtkTest.o
GtkTest.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
bazik@antares coding $

Same happens with the examples comming along with FASM:

bazik@antares coding $ cd fasm/examples/coffdemo/
bazik@antares coffdemo $ ll
total 16
-rw-r--r-- 1 bazik users 413 Jul 14 15:09 coffdemo.asm
-rw-r----- 1 bazik users 229 Jul 8 23:37 coffdemo.o
-rw-r--r-- 1 bazik users 200 Jul 8 23:36 writemsg.asm
-rw-r----- 1 bazik users 124 Jul 8 23:37 writemsg.o
bazik@antares coffdemo $ rm *.o
bazik@antares coffdemo $ fasm coffdemo.asm coffdemo.o
flat assembler version 1.39
3 passes, 229 bytes.
bazik@antares coffdemo $ fasm writemsg.asm writemsg.o
flat assembler version 1.39
1 passes, 124 bytes.
bazik@antares coffdemo $ ld coffdemo.o writemsg.o -o coffdemo
coffdemo.o: file not recognized: File format not recognized
bazik@antares coffdemo $

Which versions of GCC and LD did you use for development?
The problem is only in the COFF format...

If you need more information, just tell me what you need to know about my system.

Posted on 2002-08-06 18:46:19 by bazik
It does not depend on version of bintools, but on what emulations are supported (you can set it up and recompile to support different set of emulations). You can get the list of emulations by typing "ld -V".
Posted on 2002-08-06 18:57:07 by Tomasz Grysztar
Hmm... ok, learned something new again :)
Which kind of emulation do I need?

bazik@antares coding $ ld -V
GNU ld version 20020423
Supported emulations:
Posted on 2002-08-06 19:56:15 by bazik
You need i386coff emulation.
Posted on 2002-08-07 02:25:24 by Tomasz Grysztar
I tried about 10 times now to compile a GCC crosscompiler for i386-coff (i386-pc-coff) and always failed :(

Just curious, why can NASM compile a linkable object without i386-coff emulation? (nasm -f elf)

Is there a way to do/implement this in FASM, too?
Posted on 2002-08-09 08:15:34 by bazik
Well, I also don't know how to recompile binutils to support i386coff when they don't; but on some servers on which I have shell accounts ld supports it. Maybe we should mail someone at This is Win32Asm forum, we are allowed to be lame about Linux. :grin:

After I have implemented COFF output (and that was a hard work...) it should be quite easy to implement ELF output also. I have already downloaded a good docs on ELF format, now I need to extract from these docs what I really need, and maybe I will add this format also in some future versions (altough after reading those docs I think the COFF format is really much finer). But first I want to finally release the "coffee" (1.40) with the good documentation. Coming soon... (at least program, the docs are growing slowly)
Posted on 2002-08-10 17:59:29 by Tomasz Grysztar
And what do you think about COFF2ELF converter?
Posted on 2002-08-12 17:51:56 by Tomasz Grysztar
Sounds good :)
Posted on 2002-08-12 23:59:14 by bazik