Architecture of i386 input file is incompatible with i386:x86-64

后端 未结 4 644
不思量自难忘°
不思量自难忘° 2020-12-22 22:42

I\'m trying to create a simple kernel using Ubuntu. In the terminal I typed

ld -Ttext 0x1000 -o kernel.bin loader.o main.o Video.o

But I got

4条回答
  •  悲&欢浪女
    2020-12-22 23:28

    When compiling/linking 32-bit apps on x86_64, setting emulation to elf_i386 provides the correct elf format. So, for example, if you compile an assembler app with nasm -f elf file.asm -o file.o, the link command is ld -m elf_i386 -o exename file.o Courtesy: David

提交回复
热议问题