I know 'init' is first process that is started after the kernel is loaded, but there is an ambiguity for me. If it is a process it must have a binary executable file. However, the following shared object is compiled code that looks like an executable file, but there is no main function.
sardari@mint / $ file /sbin/init
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=7a4c688d009fc1f06ffc692f5f42ab09e68582b2, stripped
Apparently a shared object can be an executable file, but why?
Best Answer
When a file compiled with
-pie
(Position Independent Executable) such as :Then you have :
If you need more information , You can visit Position-independent code