- LinkageTypes Linkage; // The linkage of this global
- VisibilityTypes Visibility; // The visibility style of this global
- unsigned Alignment; // Alignment of this symbol, must be power of two
- std::string Section; // Section to emit this into, empty mean default
+ // Note: VC++ treats enums as signed, so an extra bit is required to prevent
+ // Linkage and Visibility from turning into negative values.
+ LinkageTypes Linkage : 5; // The linkage of this global
+ unsigned Visibility : 2; // The visibility style of this global
+ unsigned Alignment : 16; // Alignment of this symbol, must be power of two
+ std::string Section; // Section to emit this into, empty mean default