GNU Binutils'二进制文件描述符库 - 格式示例
如标题所示。我尝试阅读 BFD 的 ELF 代码,但这不是一个轻松的阅读。我还尝试从文档中获取一些内容,但我需要一个示例来了解它是如何工作的。谁能为我指出一些更简单的例子,以了解如何定义可执行格式?
编辑:看来我没有正确地提出问题。我不会问“如何创建自己的可执行格式规范?”,也不会问“哪里有好的 ELF 文档?”,而是“如何使用 GNU BFD 实现我自己的可执行格式?”。
As in title. I tried reading the BFD's ELF's code, but it's rather not a light reading. I also tried to get something from the documentation, but I would need an example to see how it works. Could anyone point me some easier example for me, to know how to define an executable format?
Edit: Looks like I didn't formulate the question properly. I don't ask "how to create own executable format specification?", nor "where is good ELF documentation?", but "how can I implement my own executable format using GNU BFD?".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你确实看过这里 http://sourceware.org/binutils/docs-2.21/bfd /index.html 和此处 http://sourceware.org/binutils/binutils-porting-guide.txt?
还研究了此处提到的 BFD 后端的 MMO 实现 http://sourceware .org/binutils/docs-2.21/bfd/mmo.html#mmo(来源:http://sourceware.org/cgi-bin/cvsweb .cgi/src/bfd/mmo.c?cvsroot=src) 可能比从 ELF 开始更简单......;-)
You did look here http://sourceware.org/binutils/docs-2.21/bfd/index.html and here http://sourceware.org/binutils/binutils-porting-guide.txt?
Also studying the MMO implementation of a BFD backend as mentioned here http://sourceware.org/binutils/docs-2.21/bfd/mmo.html#mmo (source: http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/mmo.c?cvsroot=src) might be less complex than starting with ELF ... ;-)
我同意 BFD 文档有些缺乏。这里有一些更好的来源:
以下是一些可读的介绍:
以及一些不使用 libbfd 的示例:
I agree that BFD documentation is somewhat lacking. Here are some better sources:
Here are a couple of readable introductions:
And some examples that don't use libbfd:
DOS COM 文件是最简单的格式。
在 seg:0100h 加载最多 64k 减去 256 字节,设置 DS,ES,SS=seg, SP=FFFFh 并跳转到 seg:0100h
The DOS COM file is the simplest possible format.
Load up to 64k less 256 bytes at seg:0100h, set DS,ES,SS=seg, SP=FFFFh and jump to seg:0100h