Как сам ld загружается? - PullRequest
       12

Как сам ld загружается?

0 голосов
/ 14 декабря 2018

Когда я /lib64/ld-linux-x86-64.so.2 ./a.out загружает мою a.out программу.

Но как вообще загружается /lib64/ld-linux-x86-64.so.2?

Кроме того, что делает /lib64/ld-linux-x86-64.so.2 использовать под?Вилка или клон ...?

1 Ответ

0 голосов
/ 18 декабря 2018

Обычно /lib64/ld-linux-x86-64.so.2 это ссылка на ваш динамический компоновщик.
Например, это может быть ссылка на /lib/x86_64-linux-gnu/ld-2.27.so
, вы можете проверить ссылки с помощью команды ls -l.

Также вы можете попытаться выполнить ld.so файл: и вы получите такой вывод - который ответит на ваш вопрос: 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.

И причины см. На странице руководства:
http://man7.org/linux/man-pages/man8/ld.so.8.html
А может быть, если вы действительно хотите найти источники:
https://www.gnu.org/software/binutils/

...