Click to See Complete Forum and Search --> : Help with Linux -> Windows port ?


John E
September 18th, 2009, 01:27 PM
I'm porting a program from Linux to Windows (well technically, to Cygwin). It contains one small assembly module. Fortunately there don't seem to be any system calls (i.e. int calls). It's mostly just mov / push / pop / jne / jz and similar instructions. However each function seems to be identified something like this:-

.globl the_function_name
.type the_function_name,@function

This compiles fine under Linux/as or Linux/gcc but it seems to be upsetting Cygwin/gcc. I did a bit of googling and discovered that for the .type directive, the above syntax is only valid for ELF (Linux format) targets. For COFF format targets (Unix / Windows) .type seems to do something completely different and has a different syntax.

I'm a complete duffer when it comes to assembly language - so how would I need to change that second line to make it work with my Cygwin compiler?