iPhone-mthumb-互连
操作系统我弄清楚了如何使用 -mthumb 和 -mno-thumb 编译器标志,并且或多或少地了解它在做什么。
但是 -mthumb-interlinking 标志是做什么的呢?什么时候需要它,如果我在项目设置中设置“编译拇指”,它是否为整个项目设置?
感谢您的信息!
os i figured out how to use the -mthumb and -mno-thumb compiler flag and more or less understand what it's doing.
But what is the -mthumb-interlinking flag doing? when is it needed, and is it set for the whole project if i set 'compile for thumb' in my project settings?
thanks for the info!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
打开终端并输入
man gcc
您的意思是 -mthumb-interwork 吗?
如果这与构建配置相关,您应该能够为每个配置“例如发布或调试”单独设置它。
为什么要更改这些设置?我知道使用拇指指令可以节省一些内存,但是在这种情况下节省的内存足够重要吗?
Open a terminal and type
man gcc
Do you mean -mthumb-interwork ?
If this is related to a build configuration, you should be able to set it separately for each configuration "such as Release or Debug".
Why do you want to change these settings? I know using thumb instructions save some memory but will it save enough to matter in this case?
根据手册页,如果没有该标志,则两个指令集
它说“可靠”;因此,如果没有这个选项,它们似乎仍然可以混合在一个程序中,但可能“不可靠”。我认为通常混合两个指令集是可行的,编译器足够聪明,可以弄清楚何时必须从一组指令切换到另一组指令。但是,可能存在边界情况,编译器只是无法正确理解,并且可能无法看到它应该在此处切换指令集,从而导致应用程序失败(大多数可能会崩溃)。此选项生成特殊代码,这样无论您的代码做什么,切换总是正确可靠地发生;缺点是每个全局可见函数都需要这个额外的代码,从而增加了二进制方面(我不知道它是否也会减慢函数调用速度,我个人希望如此)。
另请注意以下两项设置:
尽管我认为在构建与其他项目一起使用的库时您只需要这些;但我不确定。 GCC 拇指处理绝对是“记录不足”。
According to man page, without that flag the two instructions sets
It says "reliably"; so without that option, it seems they still can be mixed within a single program but it might be "unreliably". I think normally mixing both instructions sets works, the compiler is smart enough to figure out when it has to switch from one set to another one. However, there might be border cases the compiler just doesn't understand correctly and it might fail to see that it should switch instruction sets here, causing the application to fail (most likely it will crash). This option generates special code, so that no matter what your code does, the switching always happens correctly and reliably; the downside is that this extra code is needed for every global visible function and thus increases the binary side (I have no idea if it also might slow down function calls a little bit, I personally would expect that).
Please also note the following two settings:
Though I think you only need those, when building libraries to be used with other projects; but I don't know for sure. The GCC thumb handling is definitely "underdocumented".