修复的定义?
我在 Python Lisp 编译器和一些 C 链接器的源代码中看到过这个术语。
我的猜测是,修复只是汇编例程的一些包装,以确保对齐正确,但我对这里的任何事情都不确定。
I've seen this term in the Python Lisp compiler and some C linker's sources.
My guess is that a fix-up is just some wrapper around an Assembly routine that makes sure the alignment is right, but I'm not sure at all about anything here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“修复”是链接器术语。 这里有一个很好的讨论:
http://www.microsoft.com/msj/ 0797/hood0797.aspx
每当目标文件(.o、.obj)引用某个外部符号时,它都会输出占位符代码,如“将地址 0 放入寄存器 5”以及一条注释,显示“用 0 填充该 0”符号“foo”的实际地址”。 其他一些目标文件将定义“foo”,链接器然后将返回并将 0“修复”为正确的地址。
顺便说一句,如果没有人定义“foo”,您会收到复古 50 年代风格的错误消息,其中包含诸如“找不到对 _foo 的引用”之类的内容,或者如果您使用 C++,则更难以理解。
当“foo”的地址不适合链接器想要放置的位置时,很少会出现“修复错误”。 通常,这来自需要太大相对偏移的修复。
A "fixup" is a linker term. There's a pretty good discussion of it here:
http://www.microsoft.com/msj/0797/hood0797.aspx
Whenever a object file (.o, .obj) refers to some external symbol it will output placeholder code like "Put address 0 to register 5" and a note that says "Fill in that 0 with the actual address of symbol 'foo'". Some other object file will define 'foo', the linker will then go back and "fix up" the 0 to be the correct address.
Incidentally, if nobody defines 'foo' you get that retro 50's style error message blithering something like 'can't find reference to _foo' or even less comprehensible if you're using C++.
And pretty rarely you'll get a "fixup error" when the address of 'foo' doesn't fit where the linker wants to put it. Generally this comes from a fixup that requires a relative offset that is too large.
Linker and Loaders 是一个有趣的 Inker 资源,它解释了很多术语,并且还包含非 x86 cpu:
http://www.iecc.com/linker/ 。
来自 comp.compilers 版主的
Linker and Loaders is an interesting inker resource that explains a lot of jargon, and includes non x86 cpus here and there too:
http://www.iecc.com/linker/
from the comp.compilers moderator.