- Intel(x86-32)
- ATT&T
- MIPS
- nasm -o hello.tmp -f macho hello.s
- ld -arch i386 -macosx_version_min 10.6 -no_pie -e _main -o hello.o hello.tmp
- ./hello.o
- nasm -o hello.tmp -f macho hello.s && ld -arch i386 -macosx_version_min 10.6 -no_pie -e _main -o hello.o hello.tmp && ./hello.o
- -o hello.tmp - outfile
- -f macho - specify format
- Linux - elf or elf64
- Mac OSX - macho
- -arch i386 - specify architecture (32 bit assembly)
- -macosx_version_min 10.6 (Mac OSX - complains about default specification)
- -no_pie (Mac OSX - removes ld warning)
- -e main - specify main symbol name (Mac OSX - default is start)
- -o hello.o - outfile
- ./hello.o - execution
"ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _start from hello.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie"
- Add the "-no_pie" option to "ld" when linking
"ld: warning: -macosx_version_min not specified, assuming 10.6"
- Add the "-macosx_version_min 10.6" option to "ld" when linking
"ld: warning: option -m is obsolete and being ignored"
- Older option
"ld: warning: option -s is obsolete and being ignored"
- Older option