首页 > 系统服务 > 详细

linux(64位的系统)下nasm进行汇编链接时出现的问题

时间:2015-08-05 19:49:55      阅读:377      评论:0      收藏:0      [点我收藏+]

出现问题:

$nasm -f elf hello.asm -o hello.o

$ld -s hello.o -o hello

  ld: i386 architecture of input file `hello.o‘ is incompatible with i386:x86-64 output

 

尝试:

$ ld -m32 -s hello.o -o hello
  ld: unrecognised emulation mode: 32
  Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om i386pep i386pe

 

解决:

$nasm -f elf hello.asm -o hello.o

$ld -m elf_i386 -s hello.o -o hello

$./hello

  Hello, world!

 

linux(64位的系统)下nasm进行汇编链接时出现的问题

原文:http://www.cnblogs.com/zyx1314/p/4705366.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!