bit 32/64

【asm】64位编译32位汇编需要注意的

 

汇编语言在32位和64位下有区别
    32位的汇编在代码前增加.code32
    as可以通过--32指定生成32位汇编

在64位系统下ld链接生成32位程序:
    ld: i386 architecture of input file `xxx.o' is incompatible with i386:x86-64 output
(1)使用--oformat elf32-i386
(2)若(1)无效,可以使用-m elf_i386

原文地址:https://www.cnblogs.com/SZLLQ2000/p/4841770.html