The primary role of a linker is to handle external references and symbols, ensuring that all references made in one part of the program (such as function calls or variable declarations) are correctly linked to their definitions in other parts of the program or external libraries. This process is crucial for creating a coherent and functional executable program or library.