Sitemap
Tashi George

Tashi George

Embedded Firmware developer.

Compilation process

1 min readSep 12, 2021

The process of compilation has several stages. Let me explain the with the help of C language. The stage involved are

  • Preprocessing

We know that our source code has two types of files as per C language. They are .c files as well as .h header files. During the preprocessing, it copies remove all header files after copying all definitions and macros to .c files.

  • Compilation

The compilation is the process when each source code is converted to assembly code.

  • Assembly

In this process, the assembler converts assembly code to object code. In Linux based system, object code is of format.o while in windows it’s .obj.

  • Linker

For each source file, we have an object file. Its the responsibility of the linker to create a single executable file combining all object files.

Get Tashi George’s stories in your inbox

Join Medium for free to get updates from this writer.

A linker is the one who is also responsible for linking library files from the root directory.

The preprocessor, compiler, assembler and linker forms the toolchain. For example, Turbo C and GNU C. The GNU toolchain contains a GCC compiler by Richard Stallman.

--

--

Tashi George
Tashi George

Written by Tashi George

0 followers

Embedded Firmware developer.