This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to verify init_priorty for C++ static object initialization order?


I'm working with a C++ library. The library creates both (1) static
archive and (2) shared object artifacts. The library has four C++
static objects. Two of them are std::string's and two are library
classes.

On occasion, I see the effects of a bad shuffle of initialization
order. I usually observe it by one of the std::string's "this" pointer
being NULL during init. In an effort to remediate the C++ static
initialization order issue, we switched to GCC's init_priority (and
"#pragma init_seg(lib)" on Microsoft platforms).

I have an object file and an archive. How can I verify the priority is
embedded in both the object file and archive?

Thanks in advance.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]