0
我试图编译此为Linux拱64,我想:无法编译一个简单的应用
section .text
global _start
_start:
mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 0x80
mov eax, 1
int 0x80
section .data
msg db 'hi123', 0xa
len equ $ - msg
而且
$ nasm -f elf test1.asm
$ ld -s -o test1 test1.o
但是一个错误:
/usr/bin/ld: i386 architecture of input file `test1.o' is incompatible with i386:x86-64 output
[使用64位平台LD生成32位可执行文件(的可能的复制http://stackoverflow.com/questions/30184929/use-ld-on -64位平台生成32位可执行文件) –
您正在告诉链接器创建一个64位二进制文件,但汇编代码是为32位组装的。将'-m elf_i386'标志传递给你的链接器。 –
也在这里重复http://stackoverflow.com/questions/19200333/architecture-of-i386-input-file-is-in-comcomment-with-i386x86-64 –