Possible improvements include:
The IA-32 back end supports only the ELF file format.
OS X doesn’t support ELF files, but has its own file format, Mach-O.
Check out a discussion about the
difference between OS X and Linux assembly.
You can start by taking a look at
the OS X Assembler reference.