この方法でアセンブリファイルをコンパイルしましたnasm
:
$ nasm -f elf somefile.asm -o somefile.o
somefile.o
その後、プログラムにリンクしたいgcc
$ gcc -m32 somefile.o -o someprogramm
ただし、ファイルをリンクすると、次のエラーが出力されます。
ld: warning: ignoring file somefile.o, file was built for unsupported file format which is
not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status