官术网_书友最值得收藏!

Dynamic libraries

Dynamic libraries are libraries that are linked at load time. Dynamic libraries are more like executables without an entry point. They contain code needed by your program, and the load-time linker is responsible for providing the location of each required function to your program while your program is being loaded.

It is also possible for your program to link itself while it executes during runtime as an optimization, only linking functions that are needed (a process known as lazy loading). 

Most of the libraries provided by the operating system are dynamic libraries. To see which dynamic libraries are needed by your program, you can use the LDD tool, as follows:

> ldd a.out
linux-vdso.so.1 (0x00007ffdc5bfd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f92878a0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9287e93000)

In this example, we used the LDD tool to list the dynamic libraries needed by our simple Hello World\n example. As shown, the following libraries are needed:

  • vdso: a library provided by the operating system to speed up the process of making system calls
  • libc: the standard C library
  • ld-linux-x86-64: the dynamic linker itself, responsible for lazy-loading
主站蜘蛛池模板: 仁寿县| 繁峙县| 咸丰县| 克山县| 斗六市| 启东市| 乌恰县| 屏边| 鞍山市| 衡山县| 青川县| 余庆县| 达州市| 遵义市| 开江县| 陆河县| 万州区| 荆门市| 德庆县| 莲花县| 南靖县| 承德县| 谢通门县| 蒙自县| 龙口市| 临猗县| 宿迁市| 上林县| 阳泉市| 淮滨县| 舞阳县| 隆化县| 正阳县| 明水县| 岗巴县| 玛纳斯县| 鹰潭市| 佛山市| 呼伦贝尔市| 鲁甸县| 临夏市|