c - What and where exactly is the loader? -


i understand every bit of c compilation process (how object files linked create executable). loader (which starts program running) have few doubts.

  1. is loader part of kernel?

  2. how ./firefox or command loaded? mean type such commands terminal loads executable presume. loader component of shell?

i think i'm confused terminal/shell fits of , role is.

the format of executable determines how loaded. example executables "#!" first 2 characters loaded kernel executing named interpreter , feeding file first argument. if executable formatted pe, elf, or macho binary kernel uses intrepter format built in kernel in order find executable code , data , choose next step.

in case of dynamically linked elf, next step execute dynamic loader (usually ld.so) in order find libraries, load them, abd resolve symbols. happens in userspace. kernel more or less unaware of dynamic linking, because happens in userspace after kernel has handed control interprter named in elf file.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -