动态绑定和动态链接 [英] dynamic binding and dynamic linking

查看:228
本文介绍了动态绑定和动态链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 引用自动态绑定
    C ++

动态绑定与
正交动态链接...

dynamic binding is orthogonal to dynamic linking...

我想知道如何理解
正交的意义?是它
因为

I was wondering how to understand the meaning of orthogonal"? Is it because


  • 将源代码编译成机器码

  • compilation 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?

如果在动态链接中,任何涉及的绑定,即任何涉及的
对象(数据和/或
代码) $ b binding?

if in dynamic linking, any involved binding, i.e., any involved association of objects (data and/or code) with identifiers is dynamic binding?

谢谢!

推荐答案

正交意味着一个的存在或状态(在更抽象的意义上)完全不依赖于另一个的相应状态。在这个特定的情况下,它意味着动态链接可以发生,而不管动态绑定是否发生,反之亦然。

"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.

您也可以问:


如果在动态链接,任何涉及
绑定,即任何涉及
对象(数据和/或
代码)与标识符的关联是动态
绑定

if in dynamic linking, any involved binding, i.e., any involved association of objects (data and/or code) with identifiers is dynamic binding?

此问题无意义,因为 / em>进程。绑定可以静态发生(由编译器解析并且烧写到对象代码中)或动态地(在运行时解析),但是如何绑定的决定和解决绑定的逻辑根本不会与链接交互。

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.

这篇关于动态绑定和动态链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆