help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Global objects and Constructors ...g++


From: Chetan Risbud
Subject: Global objects and Constructors ...g++
Date: 11 Feb 2005 02:21:20 -0800
User-agent: G2/0.2

Does the compiler generates the machinie code for the __CTORS_LIST__
whose address is there in the .ctors section of the ELF object file ?

If it generates that code where that code resides in the object file ?


Can anyone tell me exactly what happens while calling the constrcutors
for the global objects that are declared in C++ program ?

I know when the global objects are declard in the C++ code .ctors
section is created in that object file. That .ctors section conatains
the address of the __CTORS__LIST__. This list is the array of function
pointers pointing to the constrctors of the class of whcihc the objects
are.

If you see the readelf utility of the Linux then virtual address of the
.ctors section and  __CTORS_LIST__ are the same. Does that mean .ctors
sections holds the array of the fucntion pointers ?

If those are not same then where I can find that function pointers
array in the object file ?

I know that __CTORS_LIST__ is the symbol introduced by the linker
script.


              ...Regards 
              Chetan Risbud



reply via email to

[Prev in Thread] Current Thread [Next in Thread]