动态加载与动态链接的区别? [英] difference between dynamic loading and dynamic linking?

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

问题描述


在调用例程之前,它不会被加载。所有例程都以可重定位的加载格式保存在磁盘上。主程序加载到内存&被执行。这被称为动态链接。


为什么这被称为动态链接?不应该是动态加载,因为在动态加载中调用动态加载之前没有加载例程,如链接被推迟到执行时间。

解决方案

动态加载意味着在加载或运行期间将库(或任何其他二进制文件)加载到内存中。



动态加载可以想象与插件类似,即在动态加载发生之前,exe可以实际执行(例如,可以使用C或C ++中的LoadLibrary调用创建动态加载)



动态链接是指在加载或运行时完成的链接,而不是创建exe时。



如果动态连接链接器,同时创建了exe,那么最小化工作。对于动态链接器来说,它实际上也必须加载库。因此它也称为链接加载器。



因此,您提到的句子可能有意义,但它们仍然相当模糊,因为我们无法推断其所指的上下文。可以告诉我们您在哪里找到这些线条和作者在谈论什么语境?


Routine is not loaded until it is called. All routines are kept on disk in a re-locatable load format. The main program is loaded into memory & is executed. This is called Dynamic Linking.

Why this is called Dynamic Linking? Shouldn't it be Dynamic Loading because Routine is not loaded until it is called in dynamic loading where as in dynamic linking, Linking postponed until execution time.

解决方案

Dynamic loading means loading the library (or any other binary for that matter) into the memory during load or run-time.

Dynamic loading can be imagined to be similar to plugins , that is an exe can actually execute before the dynamic loading happens(The dynamic loading for example can be created using LoadLibrary call in C or C++)

Dynamic linking refers to the linking that is done during load or run-time and not when the exe is created.

In case of dynamic linking the linker while creating the exe does minimal work.For the dynamic linker to work it actually has to load the libraries too.Hence it's also called linking loader.

Hence the sentences you refer may make sense but they are still quite ambiguous as we cannot infer the context in which it is referring in.Can you inform us where did you find these lines and at what context is the author talking about?

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

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