^之后 duangsuse 自然套路
然后妄想可以正常运行了 🙈
echo "#!/lib64/ld-linux-x86-64.so.2\n" > fooocat a.out >> fooo然后妄想可以正常运行了 🙈
./fooo: error while loading shared libraries: ./fooo: invalid ELF header另外你们不要以为
/lib64/ld-linux-x86-64.so.2
ldd /lib64/ld-linux-x86-64.so.2
它当然是静态链接的。要不然就要发生无尽递归的情况了
/lib64/ld-linux-x86-64.so.2 是一个库,它是一个 CLI 工具(helper program),要不然怎么链接程序呢(删掉/lib64/ld-linux-x86-64.so.2
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
You have invoked `ld.so', the helper program for shared library executables.
This program usually lives in the file `/lib/ld.so', and special directives
in executable files using ELF shared libraries tell the system's program
loader to load the helper program from this file. This helper program loads
the shared libraries needed by the program executable, prepares the program
to run, and runs it. You may invoke this helper program directly from the
command line to load and run an ELF executable file; this is like executing
that file itself, but always uses this helper program from the file you
specified, instead of the helper program file specified in the executable
file you run. This is mostly of use for maintainers to test new versions
of this helper program; chances are you did not intend to run this program.
--list list all dependencies and how they are resolved
--verify verify that given object really is a dynamically linked
object we can handle
--inhibit-cache Do not use /etc/ld.so.cache
--library-path PATH use given PATH instead of content of the environment
variable LD_LIBRARY_PATH
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names
in LIST
--audit LIST use objects named in LIST as auditors
ldd /lib64/ld-linux-x86-64.so.2
statically linked它当然是静态链接的。要不然就要发生无尽递归的情况了