RED HAT Linux & GCC – How to Compile a C program into Assembly code
There is a correlation between C code and Assembly code, that shows what exactly is happening on the machine. Assembly code is seriously enjoyable to read.
Step 1 – Create the C code. (Pico/Gedit/Nano).
Create a program called main.c
Step 2 – Compile into an executable.
gcc main.c -o userid
Step 3 – Compile into Assembly code
gcc -S main.c -o userassembly
cat userassembly | more
nm to obtain Memory locations (nod to Xerocrypt)
nm userid | more
Objdump -D userid (nod to Xerocrypt)
Love those opcodes 🙂
objdump -S userid | more
To display the Symbol table
objdump -t ./userid | more
Objdump Options – Happy reading 🙂
How to use objdump – Intel Syntax – The Visual Guide