A linker is an external program that connects identifiers with linkage across object files and libraries. For example, functions and objects declared with external linkage can refer to one shared definition, while system-library functions may reside in a library such as libc.so. The compiler frontend usually hides linking, and a dynamic linker may complete related work at program startup. section 13.2
External and internal linkage
An object such as a file-scope unsigned i can be defined in one place and named through an extern declaration elsewhere. The linker establishes that correspondence. By contrast, a file-scope object or function intended only for its own object file should have internal linkage, commonly enforced with static. section 13.2
Listing 13.2 An example of shadowing with an extern variable
#include <stdio.h> 1
unsigned i = 1;
int main(void) { 2
unsigned i = 2; /* A new object */
if (i) { 3
extern unsigned i; /* An existing object */
printf("%u\n", i); /* prints 1 */
} else {
printf("%u\n", i); /* prints 2 */
}
}
Compare a block-scope extern declaration with a new local object of the same name: the extern refers to the existing externally linked object. section 13.2

