ld: i386 architecture of input file `kernel.o‘ is incompatible with i386:x86-64 output
学习操作系统时,链接几个用nasm汇编器生成的elf文件时,出现如题所示的错误提示。
操作如下:
nasm -f elf kernel.asm -o kernel.o
nasm -f elf string.asm -o string.o
nasm -f elf kliba.asm -o kliba.o
gcc -c start.c -o start.o -fno-builtin-memcpy
ld -s -Ttext 0x30400 -o kernel.bin kernel.o kliba.o string
原创
2021-07-05 15:18:17 ·
2372 阅读 ·
7 评论