Compiling gcc with the following
gcc -fno-buillting -o0 -O $fileOutput
When I compare the objdump files of the original to the newly compiled binary with no -g all the human readable debugging information is not available anymore which makes debugging much more difficult.
==================================================================
WITH -g FLAG
==================================================================
00000000004004e6 <main>:
#include <stdio.h>
int main() {
4004e6: 55 push %rbp
4004e7: 48 89 e5 mov %rsp,%rbp
printf("Hello World\n");
4004ea: bf 80 05 40 00 mov $0x400580,%edi
4004ef: b8 00 00 00 00 mov $0x0,%eax
4004f4: e8 f7 fe ff ff callq 4003f0 <printf@plt>
4004f9: b8 00 00 00 00 mov $0x0,%eax
}
4004fe: 5d pop %rbp
4004ff: c3 retq
==================================================================
NO -g FLAG
==================================================================
00000000004004e6 <main>:
4004e6: 55 push %rbp
4004e7: 48 89 e5 mov %rsp,%rbp
4004ea: bf 80 05 40 00 mov $0x400580,%edi
4004ef: b8 00 00 00 00 mov $0x0,%eax
4004f4: e8 f7 fe ff ff callq 4003f0 <printf@plt>
4004f9: b8 00 00 00 00 mov $0x0,%eax
4004fe: 5d pop %rbp
4004ff: c3 retq
Comments