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

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
主站蜘蛛池模板: 松江区| 丰原市| 江源县| 永登县| 延川县| 绿春县| 凤台县| 且末县| 兴义市| 湖州市| 乌审旗| 贵港市| 仪征市| 隆德县| 烟台市| 禄劝| 禹城市| 施秉县| 随州市| 砚山县| 明星| 汉川市| 商洛市| 呼和浩特市| 宝鸡市| 镇沅| 镶黄旗| 新民市| 肥东县| 平江县| 马鞍山市| 涟源市| 双桥区| 普定县| 公主岭市| 桃源县| 安吉县| 嘉义县| 措勤县| 宜川县| 永安市|