What is Linker?

Software that combines object files and libraries, performs symbol resolution and relocation, and produces an executable or shared library.

Field: Linkers, Loaders & Executables

Linker in the explanations

Questions that mention Linker (16)

  1. What is the main role of a linker?
  2. Which describes the symbol resolution a linker performs?
  3. Which describes the relocation a linker performs?
  4. When linking with a static library (.a file), what does the linker put into the executable?
  5. With the GNU linker, writing a static library before the object file that uses it, as in "gcc -lmylib main.o", can cause undefined-reference errors. Why?
  6. How does a linker treat a weak symbol?
  7. What is the usual sequence for producing an executable from a C program?
  8. Which statement is correct about the object file (.o) a compiler produces from one source file?
  9. Both a.c and b.c define a non-static global function void init(void) with the same name, and they are linked. What happens?
  10. In C, what does writing "extern int count;" mean?
  11. Which describes static linking?
  12. In a C program, which statement is correct about the address where the OS first starts execution (the entry point)?
  13. What is the main purpose of name mangling, in which a C++ compiler encodes argument types and other information into symbol names?
  14. Disassembling an object file shows that an instruction calling the external function printf has a placeholder target such as 0. When is the correct value filled in?
  15. What is the difference between "sections" and "segments" in an ELF file?

Related terms

Relocation Object file Dynamic linker Symbol resolution Dynamic linking Static library Weak symbol Interrupt Assembler Symbol table

Back to the glossary