首页 > 解决方案 > llvm-as和binutils-as的区别,变量的命名

问题描述

我试着组装一个例子

测试.s:

        .file   "test.c"
        .text
        .globl  f
        .type   f, @function
f:
.LFB0:
        .cfi_startproc
        movl    $"A,B", %eax
        ret
        .cfi_endproc
.LFE0:
        .size   f, .-f
        .comm   "A,B",4,4
        .ident  "GCC: (GNU) 7.3.0"
        .section        .note.GNU-stack,"",@progbits
$ binutils-2.35/bin/as test.s
test.x86.s: Assembler messages:
test.x86.s:8: Warning: missing closing '"'
test.x86.s:8: Warning: missing closing '"'
test.x86.s:8: Error: too many memory references for `mov'
$ clang-9 -c test.s ; echo $?
0

为什么clang-9可以汇编测试而gnu-as不能呢?

PS 基本上,测试是从 python/numba/llvmlite llvm-IR 创建的(作为 llvm 优化的结果?)。

标签: gccllvmgnu-assemblerbinutils

解决方案


推荐阅读