This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

调用x264中arm汇编文件arm.S文件,编译报错

我想调用x264中的arm.S文件,我创建了一个test.S文件,在改文件中定义如下:

#include "asm.S"

.text

function x264_prefetch_ref_arm

    sub         r2, r2, #1

    add         r0, r0, #64

    and         r2, r2, r1

    add         r0, r0, r2, lsl #3

    add         r2, r1, r1, lsl #1

    pld         [r0]

    pld         [r0, r1]

    pld         [r0, r1, lsl #1]

    add         r3, r0, r1, lsl #2

    pld         [r0, r2]

    pld         [r3]

    pld         [r3, r1]

    pld         [r3, r1, lsl #1]

    pld         [r3, r2]

    bx          lr

endfunc

编译的时候报错:

bad instruction `endfunc'

bad instruction `function x264_prefetch_ref_arm'

这个是跟编译器有关系吗?

我用的是的linaro编译器gcc-linaro-arm-linux-gnueabihf-4.9-2014.09。

另外有个疑问,汇编中直接使用#include<>的对吗?不是应该用.include<>吗?

我吧#改成.后,发现编译错误又变成:

bad instruction `elf .hidden EXTERN_ASMx264_prefetch_ref_arm'

bad instruction `elf .size x264_prefetch_ref_arm,.-x264_prefetch_ref_arm'

bad instruction `elf .type EXTERN_ASMx264_prefetch_ref_arm,%function'

bad instruction `func .endfunc'

bad instruction `func .func EXTERN_ASMx264_prefetch_ref_arm'

麻烦帮我解答下,谢谢。