动态绑定和动态链接
引自动态绑定 C++,
<块引用>动态绑定正交于 动态链接...
我想知道如何理解 正交的含义?是吗? 因为
源代码编译成机器码就像深入,各种机器码的联动就像横向,所以它们是相互正交的,
(静态/动态)名称绑定是编译中的一个概念
静态/动态链接是链接中的一个概念吗?
如果在动态链接中,任何涉及的绑定,即任何涉及的 对象的关联(数据和/或 代码)和标识符是动态的 绑定?
谢谢!
Quoted from Dynamic Binding
C++,dynamic binding is orthogonal to
dynamic linking...I was wondering how to understand
the meaning of orthogonal"? Is it
becausecompilation of source code into machine code is like going deep, and linkage of various machine codes is like going horizontal, and so they are orthogonal to each other,
(static/dynamic) name binding is a concept in compilation
static/dynamic linking is a concept in linkage?
if in dynamic linking, any involved binding, i.e., any involved
association of objects (data and/or
code) with identifiers is dynamic
binding?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“正交”意味着一个人的存在或状态(在更抽象的意义上)完全不依赖另一个人的相应状态。在这种特定情况下,这意味着无论是否发生动态绑定,都可能发生动态链接,反之亦然。
作为一个实际示例,请考虑动态绑定是在运行时解析源代码中存在的函数调用应执行哪一段代码。该代码段可能存在于在链接时链接到可执行文件的库中(静态链接),也可能存在于运行时动态加载的库中(动态链接)。 绑定部分不关心链接是如何完成的;因此,它与后者正交。
你还问:
这个问题毫无意义,因为链接过程中不涉及绑定。绑定可以静态发生(由编译器解析并嵌入到目标代码中)或动态发生(在运行时解析),但如何绑定的决定以及解析绑定的逻辑根本不与链接交互。
"Orthogonal" means that the presence or status (in a more abstract sense) of the one is not dependent at all on the corresponding status of the other. In this specific case it means that dynamic linking may occur irrespective of whether dynamic binding occurs, and vice versa.
As a practical example, consider that dynamic binding is the resolution at runtime of what piece of code should be executed as a result of a function call present in the source code. That piece of code may be present in a library which is linked into the executable at link time (static linking), or it may be present in a library dynamically loaded at runtime (dynamic linking). The binding part does not care about how the linking was done; therefore, it is orthogonal to the latter.
You also ask:
This question is meaningless, as there is no binding involved in the linking process. Binding may occur statically (resolved by the compiler and baked into the object code) or dynamically (resolved at runtime), but the decision of how to bind and the logic that resolves the binding does not interact at all with the linking.