gcc -g -c ./src/hello.c -o ./obj/hello.o cd obj objdump -S hello.o No source debugging information can be seen in hello.o hello.o: file format elf32-i386
Disassembly of section .text: 00000000 <main>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 08 sub $0x8,%esp 6: 83 e4 f0 and $0xfffffff0,%esp 9: b8 00 00 00 00 mov $0x0,%eax e: 83 c0 0f add $0xf,%eax 11: 83 c0 0f add $0xf,%eax 14: c1 e8 04 shr $0x4,%eax 17: c1 e0 04 shl $0x4,%eax 1a: 29 c4 sub %eax,%esp 1c: 83 ec 0c sub $0xc,%esp 1f: 68 00 00 00 00 push $0x0 24: e8 fc ff ff ff call 25 <main+0x25> 29: 83 c4 10 add $0x10,%esp 2c: b8 00 00 00 00 mov $0x0,%eax 31: c9 leave 32: c3 ret gcc -g -c /home/yangzx/src/hello.c -o /home/yangzx/obj/hello.o Source debugging information can be seen in hello.o hello.o: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include <stdio.h> int main(void) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 08 sub $0x8,%esp 6: 83 e4 f0 and $0xfffffff0,%esp 9: b8 00 00 00 00 mov $0x0,%eax e: 83 c0 0f add $0xf,%eax 11: 83 c0 0f add $0xf,%eax 14: c1 e8 04 shr $0x4,%eax 17: c1 e0 04 shl $0x4,%eax 1a: 29 c4 sub %eax,%esp printf("hello world\n"); 1c: 83 ec 0c sub $0xc,%esp 1f: 68 00 00 00 00 push $0x0 24: e8 fc ff ff ff call 25 <main+0x25> 29: 83 c4 10 add $0x10,%esp return 0; 2c: b8 00 00 00 00 mov $0x0,%eax } 31: c9 leave 32: c3 ret -- Summary: No source debugging information with relative path by objdump Product: binutils Version: 2.17 Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: moonlight dot yang at gmail dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=5494 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils