如果程序是交叉编译的,生成的程序可能在本机ldd时看不到依赖库。 可以执行下面命令,看其依赖项: readelf -d your_exe | grep NEEDED
1. ldd命令:ldd命令可以用来查看一个可执行文件所依赖的共享库。对于静态库,ldd命令会显示“not a dynamic executable”的错误信息。可以使用以下命令来使用ldd命令: $ ldd <可执行文件> 2. nm命令:nm命令可以用来列出一个目标文件或者静态库中的符号表。符号表中包含了这个目标文件或者静态库所定义和引用的符号。
./main: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=82e7afc31da1cdbdd374658c2724dce983ccedab, for GNU/Linux 3.2.0, not stripped root@localhost:~# ldd ./main not a dynamic executable #说明当前是静态链接的 root@localhost:~# strace ....
not a dynamic executable //说明没有链接动态库 链接器链接后生成的最终文件为ELF格式可执行文件,一个ELF可执行文件通常被链接为不同的段,常见的段譬如.text、.data、.rodata、.bss等段。 分析ELF文件 1.ELF文件的段 ELF文件格式如下图所示,位于ELF Header和Section Header Table之间的都是段(Section)。一个...
not a dynamic executable main.o: ldd: warning: you do not have execution permission for`./main.o' not a dynamic executable test.c:ldd:warning:youdonot have execution permissionfor`./test.c' not a dynamic executable test.h: ldd: warning: you do not have execution permission for`./test...
End of assembler dump. [alert7@redhat62 alert7]$ ldd test not a dynamic executable -static出来的代码已经没有PLT了,GOT虽然有,已经全部为0了。 ★ 小节 抛砖引玉般简单的实例描述了下gcc常用的编译选项对代码的影响。 不正之处,还请斧正。谢谢。
not a dynamic executable % readelf -d ./t.exe | grep NEEDED 0x00000001 (NEEDED) Shared library: [libc.so.6] % dpkg -l libc6 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend ...
我的Windows10带有基于Windows Linux子系统的Ubuntu用户空间,并安装了gcc包。使用gcc -static,我构建了一个静态链接的二进制文件hello,通常的实用程序如下所示: not a dynamic executable hello: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linke 浏览3提问于2017-02-07得票数 1 ...
$ ldd gzip not a dynamic executable I'm curious: What's the most likely source of this problem? A corrupted file? Or a binary incompatibility due to being built for a much older {kernel,libc,...}? Per nos's suggestsions, here's the output of strace ./gzip:execve("./gzip", ["...
This removes from the RPATH all directories that do not contain a library referenced by DT_NEEDED fields of the executable or library. For instance, if an executable references one library libfoo.so, has an RPATH /lib:/usr/lib:/foo/lib, and libfoo.so can only be found in /foo/lib, ...