Yes, the linker will generally fold duplicate identical template instantiations away. Doing so is pretty much required to avoid an explosion in binary size when templates are involved, and to maintain some standard required invariants such as equivalence of function pointers. This behavior is sometimes called fold by name.

Beyond that, some linkers will even fold away all symbols that happen to be identical in content (i.e., compile the same code), even if they don't originate from the same definition. This is sometimes called fold by value, but unless done carefully may break the letter of the standard (i.e., because function pointers to different functions now compare equal).

Email codedump link for C++ template function, same type, multiple instantiations: shares one same copy of code? EVEN in different cpp/object files