【问题标题】:Thumb assembly under LinuxLinux下的Thumb汇编
【发布时间】:2015-10-27 22:14:51
【问题描述】:

我正在尝试使用 arm-linux-gnueabi-as 在 Ubuntu 上获取目标文件 (.o)。这是我的一组说明:

.thumb

.globl _start
_start:

cmp r0, r2
VST1.32 {D16-D17}, [R2]

当我跑步时:arm-linux-gnueabi-as -mthumb thumb.s -o thumb.o 我收到此错误: thumb.s:7: Error: selected processor does not support Thumb mode `vst1.32 {D16-D17},[R2]'

我已尝试使用参数 -mcpu=<cpu name>-march=<arch name>,例如 -mcpu=cortex-m4-march=armv7-m,但我仍然遇到同样的错误。

有没有办法模拟另一个CPU来获取thumb指令集?

【问题讨论】:

    标签: linux gcc assembly thumb


    【解决方案1】:

    您需要指定-mfpu=neon

    【讨论】:

    • 谢谢!是否可以为 x64 架构执行此操作?是否有arm64-linux-gnueabi-as 可用或者可以通过参数来完成?
    • 我也注意到了这个Error: unexpected character `w' in type specifier Error: bad instruction `mov.w r0,r1'。当我使用 ldr 而不是 mov.w 它工作正常。
    • 是的,还有aarch64版本的binutils。
    • 我应该为mov.w 使用哪种架构来解决这个问题:Error: bad instruction `mov.w r0,r1'
    • 你想让它做什么?据我所知,movw/mov.w 仅适用于常量。使用普通mov r0,r1
    猜你喜欢
    • 2013-08-18
    • 1970-01-01
    • 2011-01-28
    • 1970-01-01
    • 2012-07-31
    • 2023-03-22
    • 2010-11-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多