linux – 与nasm和ld的汇编/链接问题

linux – 与nasm和ld的汇编/链接问题

我有一个用nasm编译的示例程序集文件: nasm -f elf syscall.asm 这会生成一个syscall.o文件.我尝试将它与ld链接: ld -o syscall syscall.o ld命令失败,并显示以下错误: ld: i386 architecture of input file `syscall.o is incompatible with i386:x86-64