Linkers, Loaders and Use of Libraries Flashcards
Linkers
This is a piece of software that is responsible for linking external modules and libraries included within the code
dynamic linker
Addresses of modules and libraries are included in the file where they are referenced. When the program is run, the loader retrieves the program at the specified address so it can be executed.
The advantage here is that files remain small and external updates feed through to the main file; there is no need to rewrite the code.
static linker
Modules and libraries are added directly into the main file. This increases the size of the file. Any updates to modules and libraries externally will not affect the program. This means a specific version of a library can be used.
Loaders
Loaders are programs provided by the operating system. When a file is executed, the loader retrieves the library or subroutine from the given memory location.
Use of Libraries
Libraries are pre-compiled programs which can be incorporated within other programs
using either static or dynamic linking. They are ready-to-use and error free, so save time developing and testing modules. Another advantage of libraries is that they can be reused within multiple programs.
save programmers from having to ‘reinvent the wheel’