Program Loaders – Program Loaders in Linux and Windows

linuxprogramwindows

I was wondering what the loaders in Linux and Windows are called, i.e., their command names? Loaders' definitions are

In computing, a loader is the part of an operating system that is
responsible for loading programs.

Best Answer

There's at least 3 things that you could call "loaders" in Linux. The "ld" part of a compile, that puts together various object (.o) and archive (.a) files into a single executable is one. "ld" also checks shared object (.so) files to see if the dynamic linker can work correctly.

The dynamic linker (do man ld.so for details) gets run by the Linux kernel as part of starting up an ELF format executable. It reads linking information from the ELF file, and then (at least) maps in shared object files (.so suffix). The details are rather involved, and at least sometimes involve updating the GOT, a section in memory that maps a compiled-in branch destination to the actual, as-loaded address of the library code. See: http://netwinder.osuosl.org/users/p/patb/public_html/elf_relocs.html for a lot of details.

There's also a piece of the Linux kernel that reads in executable files, that's sometimes called a "loader". When you configure a linux kernel, you can choose to include or exclude some of these executable file formats (a.out, mainly) loaders. I had the code of linux 2.6.20.9 lying about, and I found "loaders" for different executable formats in linux-2.6.20.9/fs/: binfmt_aout.c, binfmt_elf.c, binfmt_script.c, and a few others.

I know next to nothing of how Windows does this same process, but it must do most or all of the same things.

Related Topic