Skip to content

Overview

Before we start

  • Install gcc additional lib for 32-bit compile
Terminal window
sudo apt-get install gcc-multilib -y
  • Compile using -m32 option:
Terminal window
gcc -m32 -S hello.c

GDB debugger

Terminal window
gcc -ggdb -m32 -o hello hello.c
gdb 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.
Terminal window
gcc -m32 -c hello.c
objdump -d hello.o
# or
objdump -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.