• About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
Skip to content
May 25, 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

Ddos 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
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-9458CVSS 9.8
    A vulnerability was identified in Totolink A8000RU 7.1cu.643_b20200521. The impacted element is...
  • CVE-2026-9457CVSS 9.8
    A vulnerability was determined in Totolink A8000RU 7.1cu.643_b20200521. The affected element is...
  • CVE-2026-9456CVSS 9.8
    A vulnerability was found in Totolink A8000RU 7.1cu.643_b20200521. Impacted is the function...
  • CVE-2026-9455CVSS 9.8
    A vulnerability has been found in Totolink A8000RU 7.1cu.643_b20200521. This issue affects...
  • CVE-2026-9454CVSS 9.8
    A flaw has been found in Totolink A8000RU 7.1cu.643_b20200521. This vulnerability affects...
  • CVE-2026-9436CVSS 9.8
    A flaw has been found in Totolink A8000RU 7.1cu.643_b20200521. The impacted element...
  • CVE-2026-9435CVSS 9.8
    A vulnerability was detected in Totolink A8000RU 7.1cu.643_b20200521. The affected element is...
  • CVE-2026-9434CVSS 9.8
    A security vulnerability has been detected in Totolink A8000RU 7.1cu.643_b20200521. Impacted is...
  • CVE-2026-9433CVSS 9.8
    A weakness has been identified in Totolink A8000RU 7.1cu.643_b20200521. This issue affects...
  • CVE-2026-2651CVSS 9.0
    A vulnerability in MLflow versions
Powered by CVE WATCHTOWER

Recent Zero-Day Vulnerabilities

  • Exploited in the Wild: Critical OWA Spoofing Flaw (CVE-2026-42897) Hits On-Premises Exchange Servers
  • Exploited in the Wild: Maximum CVSS 10 SD-WAN Flaw (CVE-2026-20182) Grants Admin Control
  • Exploited in the Wild: Critical 9.8 CVSS RCE Hits Canon GUARDIANWALL MailSuite
  • Exploit Code Released: Public PoC Dumps for Windows BitLocker Bypass and SYSTEM Elevation Zero-Days
  • Exploited in the Wild: “Dirty Frag” Linux Vulnerability Grants Instant Root Access
  • Under Active Attack: Ivanti EPMM Zero-Day Exploited in the Wild via Harvested Admin Credentials
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
    Copyright Daily CyberSecurity Β© All rights reserved.