0
Ich versuche, das für Linux Arch x64 zu kompilieren, ich versuche:kann nicht eine einfache Anwendung kompilieren
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
Und
$ nasm -f elf test1.asm
$ ld -s -o test1 test1.o
aber einen Fehler:
/usr/bin/ld: i386 architecture of input file `test1.o' is incompatible with i386:x86-64 output
Mögliche Duplikat [Use ld auf 64-Bit-Plattform 32-Bit ausführbare Datei zu erzeugen] (http://stackoverflow.com/questions/30184929/use-ld-on -64-Bit-Plattform-zu-generieren-32-Bit-ausführbar –
Sie sagen Ihrem Linker, um eine 64-Bit-Binärdatei zu erstellen, aber Ihr Assembly-Code wurde für 32-Bit zusammengestellt. Übergeben Sie das Flag "-m elf_i386" an Ihren Linker. –
Duplizieren Sie auch hier http://stackoverflow.com/questions/19200333/architecture-of-i386-input-file-isincompatible-with-i386x86-64 –