.size指令在这里有什么作用吗?

时间:2018-10-26 22:43:15

标签: assembly llvm gas powerpc

我目前正在尝试使用LLVM 3.7.1在x86-64主机上针对powerpc64le目标交叉编译musl 1.1.18。无法使用error: unexpected token in '.end' directive在下面显示的文件/代码上进行编译。 这不是我的问题。

来自src/internal/powerpc64/syscall.s

    .global __syscall
    .hidden __syscall
    .type   __syscall,@function
__syscall:
    mr      0, 3                  # Save the system call number
    mr      3, 4                  # Shift the arguments: arg1
    mr      4, 5                  # arg2
    mr      5, 6                  # arg3
    mr      6, 7                  # arg4
    mr      7, 8                  # arg5
    mr      8, 9                  # arg6
    sc
    bnslr+       # return if not summary overflow
    neg     3, 3 # otherwise error: return negated value.
    blr
    .end    __syscall
    .size   __syscall, .-__syscall

我的问题是:这里的.size指令是否可以执行任何操作According to the gas documentation.end伪指令表示文件的末尾,将不再进行任何处理。我在这里想念东西吗?

1 个答案:

答案 0 :(得分:2)

这似乎是GNU汇编器的未记录功能。显然,它用于以ECOFF格式发出调试信息。参见gas/config/obj-ecoff.c:259gas/ecoff.c:2981

/* ECOFF specific debugging information.  */
{ "aent",     ecoff_directive_ent,    1 },
{ "begin",    ecoff_directive_begin,  0 },
{ "bend",     ecoff_directive_bend,   0 },
{ "end",      ecoff_directive_end,    0 },