Real-Time Systems Development

17.11: C++ global constructors and destructors in ELF

17.11 C++ global constructors and destructors in ELF

The C++ global constructors and destructors are handled conveniently within the ELF format. Constructors all have to be called before entering the main() function, and destructors evoked after exiting from main(). The GNU g++ compiler inserts two auxiliary startup files (crti.o and crtbegin.o) in front of main, and two after it (crtend.o and crtn.o). Crtbegin.o contains a list of pointers to the constructor functions, arranged in the correct order.

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: EMF Meters
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.