Search code examples
c++cactivation-record

During which phase of building a binary is activation record defined?


Is it during a pre-processing or compilation stage, say on gcc? Is it different on other compilers?


Solution

  • The stack frame is created at runtime by modifying the stack register of the processor (esp for Intel x86).

    The compiler only dump specific instructions to reserve space on the stack at each function call. This space is then recovered when the function exits.