This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

"gdb vmlinux" gives wrong symbol addresses


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]