What are linkers and loaders in programming?

918 views

If you had to explain in the shortest and simplest way possible, how would you put it?

In: Engineering

4 Answers

Anonymous 0 Comments

A linker is a program that takes many small components of a program in progress and combines them into one larger program. In many cases this is actually the final .EXE file, or it may just be used to combine smaller files into a bigger file. Also some of these components may be provided by the system and not written by the programmer. Huge programs are written as many many individual components for organizational reasons as well as the effort involved in updating and rebuilding them, so they have to be combined at some step. That’s the linker’s job.

The loader is the program that is actually used to run the program with all its needs. Windows programs need DLLs to run, so a loader might be responsible for finding the DLLs needed, loading them into memory, and then combining everything together so the program can properly run. The details vary from system to system, for example the Linux loader is stored at /lib/ld-linux.so.2 for 32 bit programs, but only if dynamically linked. A statically linked program needs no loader, but then doesn’t benefit from upgrades made to system components and is a much larger executable program.

You are viewing 1 out of 4 answers, click here to view all answers.