I disassembled a simple program written in C++ and there are these two function names. I guess that ctor means constructor and dtor means destructor, and word global maybe m
They are auxiliary functions added by the compiler to construct and destroy static objects.
e.g.
std::vector some_global;
int main() { return 0; }
some_global
needs to be actually constructed (and destructed) somewhere, and C++ guarantees that construction happens before main
. One way to do this is to emit a function that happens before main
, which constructs global objects, and another function that happens after main
to destroy them.
If you stuck a breakpoint inside the std::vector
constructor and ran this program, the stack trace would show you the function that it was being initialised from.