【问题标题】:error: unexpected token in '.section' directive .section .text错误:'.section' 指令 .section .text 中出现意外标记
【发布时间】:2013-03-01 02:37:57
【问题描述】:

当我在 xcode 中编译程序集 'xx.s' 时出现一些错误 “错误:'.section' 指令中的意外标记 .section .text " xx.s中的代码如下:

.section .text

.global PreMDCT

PreMDCT:

stmdb     sp!, {r4 - r11, lr}

add         r9, r0, r1, lsl #2

sub         r3, r9, #32

movs        r1, r1, asr #2

beq         PreMDCT_END

.end

谢谢

【问题讨论】:

标签: xcode assembly arm


【解决方案1】:

虽然这是有效的 gcc / as code,但它可能不是有效的 xcode 语法。

xcode devoloper manual 表明 .text 是它自己的指令,它是第一个隐式指令。因此它可以简单地与

.text
.global asdf
asdf:
        nop
        ret
.end

甚至没有第一个指令。

【讨论】:

  • 你说得对,当我删除.section.test指令时,它可以编译成功,但是交叉编译器不友好。有什么办法可以解决这个问题。谢谢:)跨度>
  • 我怀疑.section SOME_OTHER_NAME \n .text 可以。
猜你喜欢
  • 2022-01-13
  • 1970-01-01
  • 1970-01-01
  • 2020-01-02
  • 1970-01-01
  • 2014-06-26
  • 2014-09-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多