Fix for issue #535.

The symbols must have weak_odr linkage if they result from a template instantiation.