arm-none-eabi-g++ calling globral constructor <p>I am trying to port c++ application to arm board with gcc tools (using RTOS). But my static const constructors are not being called. </p> <p>Simple code:</p> <pre><code>class TestClass { public: TestClass(); TestClass(int m); TestClass(const TestClass&amp; other); ~TestClass(); int getM() const; const TestClass&amp; operator = (const TestClass&amp; other); private: int m; }; class TestInitClass { static const TestClass TestClassObj; }; const TestClass TestInitClass::TestClassObj = TestClass(5); </code></pre> <p>I provide class definitions. But when I call this with TestInitClass::TestClassObj.getM() it returns me 0.</p> <p>There are multiple problems:</p> <ol> <li>My static const is getting allocated in .bss section. It is not getting in .ctors sections (this may be linker script problem?!)</li> <li>And even if it gets in .ctors section, how do I call these constructors</li> <li>When I use static c++ library how should I call them?</li> </ol> <p>Thanks</p>