Force variable in source file into initialized data segment on OS X?
<p>I have a <code>bool</code> type in a CPP source file. The variable <strong><em>cannot</em></strong> be made static. I want the variable placed in an initialized data segment.</p>

<p>According to the <a href="https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/MachORuntime/" rel="nofollow">OS X ABI Mach-O File Format Reference</a>, I believe the place I want the variable to reside is <code>__DATA,__data</code> from Table 2.</p>

<p>How can I force a variable an initialized data segment on OS X using Apple compilers?</p>

<p>I realize that I'm probably going to have to use something platform specific. I also realize it won't be portable C++.</p>