Display initialization order of static C++ objects in a library or program?

Matt Rice ratmice@gmail.com
Sat Jan 9 22:54:00 GMT 2016


On Sat, Jan 9, 2016 at 1:27 PM, Jeffrey Walton <noloader@gmail.com> wrote:
> I'm trying to track down the cause of a Valgrind finding for an
> uninitialized read. I'm fairly certain it has to do with C++ static
> initialization order fiasco.
>
> How do I display initialization order of static C++ objects in a
> library or program?
>
> My apologies for a basic question. I'm having a difficult time finding
> this information.
>
> Thanks in advance.

This is by its nature platform dependent, with glibc you can get this
information by setting the environment variable LD_DEBUG=libs (the
calling init: lines), but don't expect the initialization order to
produce the same results on another platform.



More information about the Binutils mailing list