检查来自/ usr/bin/ldd的源代码,我看到它使用ld-linux查找可执行文件的依赖项,尽管它首先使用--verify参数调用ld-linux.然后根据ld-linux --verify调用的退出代码,脚本的行为会有所不同.
ld-linux的手册页没有提供退出代码的任何信息,谷歌搜索没有任何价值.是否有任何文档(除了通过查看ld-linux的源代码)提供了ld-linux --verfify的退出代码列表及其各自的含义?
我没有找到任何文档,但是...
if (__builtin_expect (mode, normal) == verify)
{
/* We were called just to verify that this is a dynamic
executable using us as the program interpreter. Exit with an
error if we were not able to load the binary or no interpreter
is specified (i.e., this is no dynamically linked binary. */
if (main_map->l_ld == NULL)
_exit (1);
/* We allow here some platform specific code. */
#ifdef DISTINGUISH_LIB_VERSIONS
DISTINGUISH_LIB_VERSIONS;
#endif
_exit (has_interp ? 0 : 2);
}
Run Code Online (Sandbox Code Playgroud)
所以...
没有其他代码。
| 归档时间: |
|
| 查看次数: |
999 次 |
| 最近记录: |