在 OSX 上加载/执行 ELF 文件的可能性

发布于 2024-08-27 14:55:59 字数 159 浏览 3 评论 0原文

我只是好奇在 OSX 上加载和执行 elf 文件的可能性。我知道标准可执行格式是 MACHO,但 NASM 无法生成 MACHO 对象的调试信息(并且我需要使用 NASM)。我想这是一个很遥远的事情,但我不认为我可以使用 ELF 文件。我可以用 NASM 构建它们,但我似乎无法将它们与 LD 链接起来。

I'm just curious as to the possibility of loading and executing elf files on OSX. I know the standard executable format is MACHO, but NASM is unable to generate debug information for MACHO objects (and I am required to use NASM). I imagine its a long shot, but I don't suppose I can use ELF files. I can build them with NASM, but I can't seem to even link them with LD.

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

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

发布评论

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

评论(2

抱猫软卧 2024-09-03 14:55:59

最好的 OS X 内部书籍的作者有一些代码,展示了如何编写内核扩展来处理另一种可执行文件格式 此处。他举了两个例子:使用 Apout 运行 Google Native Client (NaCl) ELF 应用程序和 PDP-11 应用程序。

我不确定这个软件有多成熟。目前它支持 Leopard 及更好的版本。

The author of the best OS X internals book has some code showing how you'd write a kernel extension to handle another executable file format here. He gives two examples: running running Google Native Client (NaCl) ELF applications and PDP-11 apps with Apout.

I'm not sure how mature this software is. It currently supports Leopard and better.

独留℉清风醉 2024-09-03 14:55:59

现在有一个“对象转换器”程序,声称它可以将 ELF 文件转换为 MACHO 文件,以及可执行文件和对象/加载程序文件的其他几种转换。有关详细信息,请参阅 http://agner.org/optimize/#objconv。还没有尝试过,但有大量可用的文档。

There's now an 'object converter' program that says it can convert ELF files to MACHO files, plus several other conversions for executable and object/loader files. See http://agner.org/optimize/#objconv for more information. Haven't tried it but there's extensive documentation available.

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