On Linux object files have extension ".o", and you make them with the "-c" flag. So this will create "foo.o" from "foo.c":gcc foo.c -c |
On Windows, object files have
extension ".obj", and you make them with the "/c" flag. So this
creates "foo.obj" from "foo.c":cl foo.c /c |
On
Linux static library files have extension ".a", and you make them with
the "ar cr" tool. So this will create "foo.a" from "foo.o" and
"bar.o":ar cr foo.a foo.o |
On
Windows, static library files have extension ".lib", and you make them
with the "link /lib" tool. So this creates "foo.obj" from "foo.c":link /lib /out:foo.lib foo.obj |
On
Linux executables have no filename extension. You specify the
executable name with the "-o" flag. You can also build
executables yourself with "ld", but it's trickier.gcc -o bar bar.o foo.a |
On
Windows, executables are named ".exe". cl /o bar.exe bar.obj foo.lib |
objdump -hdrC foo.oor on Windows using the Microsoft tool dumpbin:
dumpbin /disasm foo.obj(both objdump and dumpbin have zillions of additional parameters and options.)
.section ".text"before writing assembler instructions, or
.section ".rodata"before defining read-only strings or tables.
.section ".rodata"
my_str:
.ascii "Wazzup?\n\0"
.section ".text"
foo:
push $my_str
call printf
pop %eax
ret