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

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
主站蜘蛛池模板: 桂东县| 克山县| 丹东市| 松溪县| 郎溪县| 康马县| 广东省| 柳河县| 自治县| 抚宁县| 乐安县| 屯门区| 陈巴尔虎旗| 高台县| 仁布县| 招远市| 伊川县| 阳西县| 开江县| 恩施市| 车致| 洪江市| 东兰县| 仪陇县| 镇巴县| 郸城县| 文安县| 定南县| 宁阳县| 富源县| 墨脱县| 连云港市| 延长县| 承德市| 湖北省| 义马市| 合江县| 深圳市| 桓仁| 九台市| 湛江市|