Identical code folding (ICF)
The linker optimization that finds functions with byte-identical machine code and keeps just one copy.
C++ templates are the big source: after monomorphization, std::vector<int*> and std::vector<long*> often compile to exactly the same instructions under different names. The linker compares the sections, relocations included, and points every reference at a single survivor. Microsoft's linker has long done this under /OPT:ICF; on Unix it arrived with Google's gold and now lives in lld and mold too. Large programs such as Chromium shrink noticeably.
The snag is that C and C++ promise distinct functions have distinct addresses. Code that compares function pointers or uses them as keys can break when two functions suddenly become one. Hence a safe mode that only folds functions whose address is never taken, and an aggressive mode that folds everything and hopes nobody notices.