My question pertains to the order of initialization of global objects. It is discussed to some extent here: C++: When (and how) are C++ Global Static Constructors Called?
What I would like to know is, how is it guaranteed that some system library objects (can't think of an example though) are initialized before they are used in application? (I know the solution is to wrap such object in a function, but I want to understand how it is dealt in compilers today)
This is also discussed in the book "linkers and loaders" by John Levine, while talking about .init and .finit sections, but the current state of art is not clear.