assembly - 这里的 .size 指令有什么作用吗?
问题描述
我目前正在尝试使用 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
这里的指令有什么作用吗?根据 gas 文档,该.end
指令表示文件的结束,不会再进行任何处理。我在这里错过了什么吗?
解决方案
这似乎是 GNU 汇编器的一个未记录的特性。显然它用于以 ECOFF 格式发出调试信息。见gas/config/obj-ecoff.c:259 和gas/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 },
推荐阅读
- html - 如何使字形图标或图像在 sidenav 中正确对齐
- java - Java继承:不同对象的相同方法
- r - 复制数据框中列中的前 x 个字符
- javascript - JQuery在事件开始时应用css函数,在结束时恢复
- javascript - ReactJS Button 没有调用 onClick 事件
- python - 在字符串中查找具有已知字符位置的单词
- c# - .NET 在 Web 应用程序中从何处启动 RabbitMQ 客户端连接
- automapper - 自动映射器是否适用于计算属性?
- php - 如何通过上传 CSV 文件使用 php 更新数据库?
- r - 子集 Data.frame 多个条件