Windows 可移植可执行文件如何跨机器体系结构移植

发布于 2024-08-12 10:11:55 字数 107 浏览 3 评论 0原文

Windows 可移植可执行文件真的可以跨机器架构移植吗?如果是这样,它是如何运作的?如果不是,那么“可移植可执行文件”是什么意思或者可执行文件的哪一部分是可移植的?

谢谢,西瓦钱德兰

Is Windows Portable Executables are really portable across machine architectures? If so how it works? If not then what does "Portable Executable" mean or which part of executable is portable?

Thanks, Siva Chandran

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

十雾 2024-08-19 10:11:55

可执行文件本身不可移植。 PE 格式是“可移植的”,因为不同体系结构的可执行文件使用相同的 PE 格式,但 PE 文件中的可执行代码特定于单个处理器体系结构。

实际上,这意味着许多相同的编译器和链接器代码可以重用于不同的体系结构,并且用于检查可执行文件的工具可以(在某种程度上)适用于“外部”可执行文件。

(我在这里谈论的是本机可执行文件 - .NET 程序集也使用 PE 格式并且可以真正可移植。)

The executables aren't themselves portable. PE format is "portable" in the sense that executables for different architectures use the same PE format, but the executable code within a PE file is specific to a single processor architecture.

In practice this means that a lot of the same compiler and linker code can be reused for different architectures, and that tools for examining executables can (to some extent) work for "foreign" executables.

(I'm talking about native executables here - .NET assemblies also use PE format and can be truly portable.)

春庭雪 2024-08-19 10:11:55

来自维基百科:
“术语‘可移植’是指该格式在多种操作系统软件架构环境中的多功能性。”

http://en.wikipedia.org/wiki/Portable_Executable

From Wikipedia:
"The term "portable" refers to the format's versatility in numerous environments of operating system software architecture."

http://en.wikipedia.org/wiki/Portable_Executable

醉态萌生 2024-08-19 10:11:55

嗯,它是可移植的,因为该格式可用于各种平台上的可执行文件(SkyOS 在切换到 ELF 之前就使用了它)。它不能通过独立于平台的代码进行移植,或者如果您在一个操作系统上生成一个 PE 文件,那么它可以在另一个操作系统上运行。

Well, it is portable in means of that the format can be used for executables on various platforms (SkyOS used it before they switched to ELF). It is not portable in means of platform independent code or that if you produce a PE file on one OS that it runs on another.

蓝眸 2024-08-19 10:11:55

PE 文件只是二进制应用程序数据的容器。
它们允许针对不同的 CPU 架构(甚至非 CPU 软件架构,如 .Net)。这就是为什么它们被称为“便携式”。

然而,它们包含的每个二进制应用程序映像都只适合一种架构。

PE-files are just containers for binary application data.
They allow to target different CPU architectures (or even non-CPU software architectures like .Net). That is why they are called "portable".

Each binary application image they contain, however is suited for exactly one architecture.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文