Skip to content
June 16, 2026
  • Linkedin
  • Twitter
  • Facebook
  • Youtube

Daily CyberSecurity

Zero-hour alerts. Unmatched analysis.

Primary Menu
  • Home
  • CVE Watchtower
  • Cyber Criminals
  • Data Leak
  • Linux
  • Malware
  • Vulnerability
  • Submit Press Release
  • Vulnerability Report
Light/Dark Button
  • Home
  • Linux
  • How to Use GCC/G++ compiler: Pre-Processing,Compiling,Assembling,Linking
  • Linux
  • Technique

How to Use GCC/G++ compiler: Pre-Processing,Compiling,Assembling,Linking

Do Son August 4, 2017 2 minutes read

Gcc

GCC (GNU Compiler Collection, GNU Compiler Suite), is a set of GNU developed by the programming language compiler. It is a free software released by the GPL and LGPL licenses and a key part of the GNU program and is the standard compiler for free Unix and Apple Mac OS X operating systems. GCC (especially the C language compiler) is also often considered a de facto standard for cross-platform compilers.

Usage

Example code: hello.c

#include <stdio.h>

int main()
{
printf("hello world!\n");
return 0;
}

Compile

gcc hello.c -o hello

./hello

In essence, the compilation process is divided into four stages, namely Preprocessing, Compilation, Assembly, and Linking.

Preprocessing

gcc’s -E option allows the compiler to stop after preprocessing and output the preprocessing results. In this case, the result of the preprocessing is to insert the contents of the stdio.h file into hello.c.

Compilation

After preprocessing, you can compile the generated hello.i file directly and generate the assembly code:
gcc -S hello.i -o hello.s

-S Compile only; do not assemble or link
-o <file> Place the output into <file>

Assembly

For the assembly code file test.s generated in the previous section, the gas assembler is responsible for compiling it as an object file, as follows:
gcc -c hello.s -o hello.o

Linking

The gcc connector is provided by gas and is responsible for linking the target file of the program to all the additional target files needed to eventually generate the executable file. Additional target files include static link libraries and dynamic link libraries.

For the hello.o generated in the previous section, connect it to the C standard input and output library, and finally generate the hello program

gcc hello.o -o hello

G++

The Compile process

Pre-Processing

g++  -E  hello.cpp  -o  hello.i

Compiling

g++  -S  hello.i  -o   hello.s

Assembling

g++  -c  hello.s  -o  hello.o

Linking

g++  hello.o  -o  hello

 

Share this article:

Facebook Post LinkedIn Telegram

Related posts:

  1. EmmaDE 2 1.01 releases, an all-in-one GNU/Linux distribution
  2. Ubuntu provided a smaller image file for the upcoming Ubuntu 18.04 LTS, only 28MB
  3. Linux Mint 19 “Tara” Cinnamon lets user to set the volume all the way to 150%
  4. CentOS 7.5 (1804) officially released, based on secure and stable RHEL
  5. CVE-2024-26581 PoC Exploit Released: Linux Systems at Risk of Root Compromise
Written by
@DdoS · Security Researcher

Do Son

Do Son is the Founder and Editor of SecurityOnline.info. Working in cybersecurity since 2013, he reports on vulnerabilities, malware, and emerging threats, providing timely analysis to help organizations and individuals stay ahead of evolving risks.

Tags: Assembling Compiling Linking Pre-Processing

Search

Translation

CVE WATCHTOWER
🚨

Receive alerts for vulnerabilities being exploited in the wild.

⚡

Get notified instantly when a Proof of Concept (PoC) exploit is published.

🔍

Access critical info on vulnerabilities even when marked as "RESERVED".

🧠

Insights powered by decades of expertise and global intelligence sources.

🎯

Customize alerts with up to 10 keywords for your specific tech stack.

📊

Export the raw CVE database for SIEM integration and reporting.

Upgrade Package

🔴 Live Critical Threats

  • CVE-2026-48714CVSS 9.1
    i18next-http-middleware is a middleware to be used with Node.js web frameworks like...
  • CVE-2026-48713CVSS 9.1
    Versions prior to 2.6.6 are vulnerable to prototype pollution via crafted missing-key...
  • CVE-2026-9691CVSS 9.8
    Unauthenticated PHP Object Injection in Integration for ActiveCampaign and Contact Form 7,...
  • CVE-2026-52703CVSS 9.6
    Unauthenticated Path Traversal in FastDup
  • CVE-2026-52693CVSS 9.3
    Unauthenticated SQL Injection in eCommerce Product Catalog
  • CVE-2026-49781CVSS 9.8
    Unauthenticated PHP Object Injection in OttoKit
  • CVE-2026-49776CVSS 9.3
    Unauthenticated SQL Injection in GPTranslate – Multilingual AI Translation for WordPress: Automatically...
  • CVE-2026-49770CVSS 9.8
    Unauthenticated PHP Object Injection in WP Travel Engine
  • CVE-2026-49769CVSS 9.8
    Unauthenticated PHP Object Injection in wpForo Forum
  • CVE-2026-49768CVSS 9.8
    Unauthenticated PHP Object Injection in Happyforms
Powered by CVE WATCHTOWER

Recent Zero-Day Vulnerabilities

  • GreatXML BitLocker Bypass: Public PoC Exploit Disclosed
  • Check Point VPN Vulnerability Exploited in the Wild with Ransomware Links
  • Weekly Threat Intelligence: June 1 to June 7, 2026
  • Cisco SD-WAN Vulnerability Exploited in the Wild with Root RCE Risks
  • Android Zero-Day Flaw Exploited in the Wild: June 2026 Patches Released
  • Exploited in the Wild: Critical OWA Spoofing Flaw (CVE-2026-42897) Hits On-Premises Exchange Servers
Our Websites
  • Penetration Testing Tools
  • The Daily Information Technology
  • Daily CyberSecurity

    • About SecurityOnline.info
    • Advertise with us
    • Announcement
    • Contact
    • Contributor Register
    • Login
    • About SecurityOnline.info
    • Advertise on SecurityOnline.info
    • Contact Us

    When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works

    • Disclaimer
    • Privacy Policy
    • DMCA NOTICE
    • Linkedin
    • Twitter
    • Facebook
    • Youtube
    © 2017 - 2026 Daily CyberSecurity. All Rights Reserved.