在我的 Debian x86 32 位中,当我执行 readelf -r /usr/lib/libstdc++.so.6 | grep pthread,我得到这个输出:
000eceac 00006206 R_386_GLOB_DAT 00000000 pthread_cancel
000ed058 00000807 R_386_JUMP_SLOT 00000000 pthread_cond_destroy
000ed148 00001207 R_386_JUMP_SLOT 00000000 pthread_cond_signal
000ed1e8 00001e07 R_386_JUMP_SLOT 00000000 pthread_key_create
000ed320 00002a07 R_386_JUMP_SLOT 00000000 pthread_once
000ed418 00003607 R_386_JUMP_SLOT 00000000 pthread_getspecific
000ed42c 00003a07 R_386_JUMP_SLOT 00000000 pthread_mutex_unlock
000ed4ec 00004607 R_386_JUMP_SLOT 00000000 pthread_create
000ed54c 00004b07 R_386_JUMP_SLOT 00000000 pthread_equal
000ed678 00005607 R_386_JUMP_SLOT 00000000 pthread_mutex_lock
000ed71c 00006007 R_386_JUMP_SLOT 00000000 pthread_cond_wait
000ed7b0 00006907 R_386_JUMP_SLOT 00000000 pthread_key_delete
000ed8b4 00007307 R_386_JUMP_SLOT 00000000 pthread_cond_broadcast
000ed8c0 00007507 R_386_JUMP_SLOT 00000000 pthread_detach
000ed8f0 00007a07 R_386_JUMP_SLOT 00000000 pthread_setspecific
000ed968 00007c07 R_386_JUMP_SLOT 00000000 pthread_join
但是,当我列出 /usr/lib/libstdc++.so.6 libpthread 的依赖项时,没有列出:
john@ThirdEarth:~$ ldd /usr/lib/libstdc++.so.6
linux-gate.so.1 => (0xb77df000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb76ad000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7566000)
/lib/ld-linux.so.2 (0xb77e0000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7547000)
那么动态加载器是如何解决这些依赖关系的呢?我发现了与 __gmon_start__ 类似的问题,粗略地说,这个符号的定义在哪里?