Link-time substitution done properly

that is, functions that share the same translation unit must either
all be stubbed or all linked in from the library. No mixing within
a translation unit. They may, however, share the same library.