C

Execution flow

  1. The GNU Compiler Collection (GCC) converts our C code into an assembly specific to our CPU architecture like x86_64, amd64, arm64.
  2. The assembler compiles the assembly into a group of binaries, also called object files.
  3. The linker combines the object files and libraries into the final binary.
  4. The machine executes the final binary.

Memory management

Memory layout

Below is the memory layout listed from top to bottom in the memory space.

Common memory bugs

Segmentation fault

A segmentation fault occurs when a program tries to access a memory region it is not allowed to. Some examples are listed below.

Stack overflow

A stack overflow happens when a program uses too much stack memory. Some examples are listed below.

Dependency management

References

←Previous Next→