有什么方法可以告诉编译器为某个架构构建了一个过程中涉及的任何共享库或可执行文件吗?

发布于 2025-01-25 10:56:24 字数 292 浏览 5 评论 0原文

我假设以下内容:

  1. 调用一个函数,该函数不存在于当前对象文件中,编译器需要考虑该所谓的函数是(可能)不是为同一体系结构构建的,并且做诸如Vzeroupper之类的令人讨厌的事情,并且无法保留事物同时,在寄存器中。

有什么办法告诉编译器,情况并非如此?

因此,编译器可以假设,所有共享库(可能除了某些系统库除外)都是为相同的体系结构构建的,并且当调用位于另一个共享对象内的代码时,无需Vzeroupper。

我认为这可以通过与-flto进行部分完成。但是我不确定如何为共享图书馆实现这一目标。

I assume the following:

  1. calling into a function, which does not reside in the current object file, the compiler needs to consider that this called function was (likely) not built for the same architecture and do such nasty things as VZEROUPPER and cannot keep things in registers meanwhile.

Is there any way to tell the compiler, that this is not the case?

So that the compiler can assume, that all shared libraries (potentially except certain system libraries) are build for the same architecture and that there is no need for VZEROUPPER when calling into code located inside another shared object.

I think this can partially be accomplished by building with -flto. But I'm not certain how to accomplish this for shared libraries.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文