Skip to content

elf#

GCC Compilation Stage

GCC is a collection of compilers.

The C compiler itself turns C code into an assembly code listing, and this is sent to the assembler to be converted into an object file and later linked into a target binary.

If you only want some of the stages of compilation, you can use -x (or filename suffixes) to tell gcc where to start, and one of the options -c, -S, or -E to say where gcc is to stop.

EXEC ELF Walkthrough

Previously we've compiled our C demo program with gcc -static command.

By passing a -static option, we demand GCC to change its default link policy from dynamic to static.

In this article, I'll practice using GNU binutils to take a close look at the b.out product.

GCC Compilation Quick Tour - static

Previously, we've taken a look at the basic compilation of C programs using GCC. It links dynamically by default.

In this article, we simply add a -static option to GCC to change its default link policy from dynamic to static.

We then go on to make a basic comparison of the processes of dynamic linking and static linking.

GCC Compilation Quick Tour - dynamic

The compilation is the process of converting the source code of the C language into machine code.

As C is a mid-level language, it needs a compiler to convert it into an executable code so that the program can be run on our machine.

In this article, let's do a hands-on practice to take a close look at the basic compilation of C program with GCC.

GNU Binutils - strings

strings - print the sequences of printable characters in files.

For each file given, GNU strings prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by an unprintable character.

strings is mainly useful for determining the contents of non-text files.