This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
"gdb vmlinux" gives wrong symbol addresses
- From: Vivek Goyal <vgoyal at in dot ibm dot com>
- To: gdb at sourceware dot org
- Cc: Dave Anderson <anderson at redhat dot com>
- Date: Fri, 18 Aug 2006 14:38:07 -0400
- Subject: "gdb vmlinux" gives wrong symbol addresses
- Reply-to: vgoyal at in dot ibm dot com
Hi,
I am trying to run gdb with kernel vmlinux to find out symbol addresses.
#> gdb vmlinux
(gdb) p &linux_banner
If I link my vmlinux with linker option --emit-relocs then gdb seems
to be giving wrong values for the symbols.
Following are two outputs.
vmlinux linked without option --emit-relocs
(gdb) p &linux_banner
$1 = (char (*)[162]) 0xc0344000
vmlinux linked with option --emit-relocs
(gdb) p &linux_banner
$1 = (char (*)[162]) 0x8068a000
Above address is not a kernel address at all.
I have compiled my kernel with -g for i386 machine. I am using gdb
version 6.3
Any suggestions regarding where the anomaly is will help.
Thanks
Vivek