[fix] Set linkage to internal only if default visibility
[fix] Set linkage to internal only if default visibility

If global value visibility is hidden then making its linkage internal
would set automatically its visibility to default. This can be a
problem for the linker because a symbol that was hidden before it's
now exposed. This might create duplicate symbols. The other visibility
type is protected. For now, we also give up if visibility is
protected.

ashish-gehani/OCCAM,SRI-CSL/OCCAM,SRI-CSL/OCCAM,ashish-gehani/OCCAM,SRI-CSL/OCCAM,SRI-CSL/OCCAM,ashish-gehani/OCCAM,ashish-gehani/OCCAM,SRI-CSL/OCCAM