动态绑定和动态链接

发布于 2024-10-27 04:54:23 字数 700 浏览 3 评论 0原文

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

    <块引用>

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

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

    • 源代码编译成机器码就像深入,各种机器码的联动就像横向,所以它们是相互正交的,

    • (静态/动态)名称绑定是编译中的一个概念

    • 静态/动态链接是链接中的一个概念吗?

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

谢谢!

  1. Quoted from Dynamic Binding
    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?

  2. 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 技术交流群。

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

发布评论

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

评论(1

渔村楼浪 2024-11-03 04:54:23

“正交”意味着一个人的存在或状态(在更抽象的意义上)完全不依赖另一个人的相应状态。在这种特定情况下,这意味着无论是否发生动态绑定,都可能发生动态链接,反之亦然。

作为一个实际示例,请考虑动态绑定是在运行时解析源代码中存在的函数调用应执行哪一段代码。该代码段可能存在于在链接时链接到可执行文件的库中(静态链接),也可能存在于运行时动态加载的库中(动态链接)。 绑定部分不关心链接是如何完成的;因此,它与后者正交

你还问:

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

这个问题毫无意义,因为链接过程中不涉及绑定。绑定可以静态发生(由编译器解析并嵌入到目标代码中)或动态发生(在运行时解析),但如何绑定的决定以及解析绑定的逻辑根本不与链接交互。

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

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

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.

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