Overview
Before we start
- Install gcc additional lib for 32-bit compile
sudo apt-get install gcc-multilib -y
- Compile using
-m32
option:
gcc -m32 -S hello.c
GDB debugger
gcc -ggdb -m32 -o hello hello.cgdb hello
(gdb) list(gdb) break main(gdb) run(gdb) next
Objectdump
- The objdump command-line parameters specify what functions the program will perform on the object code files, and how it will display the information it retrieves.
gcc -m32 -c hello.cobjdump -d hello.o# orobjdump -d hello
- The memory addresses referenced in the
hello.o
are zeroed out. - These values will not be determined until the linker links the application and prepares it for execution on the system.