Generate correct linkage for all global types in capability mode.

Fixes #8