问题描述
我正在尝试在我的汇编代码中混合使用 ARM 和 THUMB 指令.例如,在下面的代码中,我尝试使用这两种模式:
I am trying to mix ARM and THUMB instructions in my assembly code. For example, in the following code I try to use both modes:
.thumb @ .code 16
.section __TEXT,__text
.globl mySymbol1
mySymbol1:
....
.arm @ .code 32
.section __TEXT,__text
.globl mySymbol2
mySymbol2:
...
现在,根据我的理解,当我将此代码编译到库中并通过 nm 运行时,mysymbol1 应该显示为 arm 而 mysymbol2 应该显示为 thumb,即,
Now, as per my understanding when I compile this code into a library and run it through nm, mysymbol1 should show up as arm and mysymbol2 should show up as thumb, i.e,
0000xxxx (__TEXT,__text) external mySymbol1
0000yyyy (__TEXT,__text) external [Thumb] mySymbol2
但两者都显示为手臂.我在这里想念什么?我的汇编命令是:
But both are showing up as arm. What am I missing here? My assembler command is:
as -arch armv7 -o a.o a.s
推荐答案
你需要在 thumb 标签前加上 .thumb_func 才能让它们成为 thumb 目标,否则 gnu 工具会将其视为 arm 目标.(是的,对于要用作拇指目标的每个标签,您都需要 .thumb 一次和 .thumb_func).很多例子http://github.com/dwelch67
you need .thumb_func before the thumb labels for them to be thumb targets otherwise the gnu tools will treat it as an arm target. (yes you need the .thumb once AND .thumb_func for EVERY label you want to use as a thumb target). Many examples http://github.com/dwelch67
这篇关于混合 ARM 和 THUMB 指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)