iPhone组装,与LDR参数编译错误 [英] iPhone assembly, compilation error with LDR parameters

查看:309
本文介绍了iPhone组装,与LDR参数编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用X code 4.2和Apple LLVM compiller 3.0(无拇指)编译一些组装code(如Theora格式库的一部分),但也有一些错误的LDR(NE)的说明

 的.text
.SET DEC_OPB,0xC944
ldrne R2,= 258014 @错误:符号L0不支持搬迁。错误:未定义的局部符号0(0F或0B)
LDR R6,= 0x00800080 @错误​​:符号L0不支持搬迁。
LDR R5 = DEC_OPB @错误:符号L0不支持搬迁。错误:未定义的局部符号0(0F或0B)
LDR R5,DEC_OPB @错误:偏移(51024)坏直接的价值。错误:不支持的符号搬迁(空)

是否有可能取代一些其他指令的线路?或与常数取代他们?
请帮帮忙,因为这个帖子 LLVM-GCC汇编:LDR语法对我没有帮助来解决这个问题。


解决方案

 的.text
.SET DEC_OPB,0xC944
ldrne R2,r2num
LDR R6,r6num
LDR R5,r5num
...r2num:.word 258014
r6num:.word 0x00800080
r5num:.word DEC_OPB

当你做的LDR R2,为0x1234,汇编器会寻找一个地方就近地方号码,然后使用PC相对地址加载它。如果汇编找不到你得到一个错误的地方,我不知道那是什么投诉是怎么回事。犯规听起来像是正确的错误。这两种解决方案上面,你放置明确的价值观,而不是依赖于汇编程序,或者你把一个分支阴影.pool或其他类似的指令,或者说你不会执行通过鼓励汇编用它来其他一些地方放置这些类型的常量。

  B某处
.pool

我从错误信息别的可能去怀疑。发表回复或者编辑或问题,如果是这样的话。

I'm trying to compile some assembly code (as part of Theora library) using XCode 4.2 and Apple LLVM compiller 3.0 (no thumb), but there are some errors in ldr(ne) instructions:

.text
.set DEC_OPB, 0xC944
ldrne   r2, =258014     @ ERROR: Unsupported relocation on symbol L0. ERROR: Undefined local symbol 0 (0f or 0b)
ldr r6, =0x00800080     @ ERROR: Unsupported relocation on symbol L0.
ldr r5, =DEC_OPB        @ ERROR: Unsupported relocation on symbol L0. ERROR: Undefined local symbol 0 (0f or 0b)
ldr r5, DEC_OPB         @ ERROR: Bad immediate value for offset (51024). ERROR: Unsupported relocation on symbol (null)

Is it possible to override those lines with some other instructions? Or to replace them with constants? Please help, because this post llvm-gcc assembler: LDR syntax didn't help me to solve this problem.

解决方案

.text 
.set DEC_OPB, 0xC944 
ldrne r2,r2num 
ldr r6,r6num 
ldr r5,r5num 
...

r2num: .word 258014
r6num: .word 0x00800080
r5num: .word DEC_OPB

when you do the ldr r2,=0x1234, the assembler looks for a place nearby to place that number and then uses a pc relative address to load it. If the assembler cannot find a place you get an error, I dont know if that is what the complaint was about. doesnt sound like the right error. The two solutions are the above where you explicitly place the values and not rely on the assembler, or you put a .pool or other similar directive in a branch shadow or some other place that you wont execute through to encourage the assembler to use it to place these kinds of constants.

b somewhere
.pool

I suspect from the error message something else may be going. post a reply or edit or question if that is the case.

这篇关于iPhone组装,与LDR参数编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆