What happens when you type gcc main.c

What happens when you type gcc main.c

As a summary, we can say that the compilation process has four stages or steps that allow our C high-level code to become an executable code with a plus: we can execute each of them and take control of them. Let's see:

Stages, Inputs and Outputs.

For example, if I want to see the result of each stage we can execute:

No hay texto alternativo para esta imagen

In the above image we can see how to take the source code and become it preprocessed code!

No hay texto alternativo para esta imagen

Once we had preprocessed, we can generate the assembly code like the previous image show us.

No hay texto alternativo para esta imagen

At this point, you can generate the object code (binary), and to be ready to create the executable file if you want.

Of course, you can generate the process in only one sentence, but under the hood, the compiler executes each step. And, on the other hand, we can generate until intermediate stages to take to another process.

To view or add a comment, sign in

More articles by Gonzalo Gomez Millan

  • Linux, ELF, and Hacking!

    What is ELF? The Executable and Linkable Format, otherwise called ELF, is the nonexclusive document design for…

  • Why The Virtual Memory (VM)

    History in short In 1979 was implemented the 3BSD by researchers at Berkeley. That was the first Unix release with…

  • Hacking The Linux Kernel

    Linux architecture has a lot of relevant pieces that allow it to work flexibly and powerfully. The file system /proc is…

  • Voici d'emploi - Job posting on third platforms (Torre.co)

    Our project helps people solve a critical problem: find a job. In this case, is through making viral on the internet…

  • Post-incident analysis

    A new functional requirement that was developed without doing an impact analysis on the architecture. Issue summary As…

  • Internet of things as a day-to-day story

    It was 1999. Kevin Ashton worked for Procter & Gamble (P&G), and was 28 years old and tried to solve a problem: the…

  • How Do SQL Database Engines Work?

    To many programmers, SQL RDBMS is a magical black box. A document can help clear up a lot of the mystery.

  • Artificial Intelligence vs Machine Learning

    For dummies - In memory of Margarita, my grandmother! What about Artificial Intelligence (I.A.

  • Python is powerful but could be tricky

    What keep in mind to avoid the tricky and get the power Python is an interpreted, high-level, general-purpose…

  • Do you want to take speed in the development software process? (II)

    Without libraries what have we? We have no past and no future! In programming, a library is a collection of…

Insights from the community

Others also viewed

Explore topics