linux-mips
[Top] [All Lists]

Corrupted symbols for MIPS debugging...

To: binutils@sourceware.cygnus.com, linux-mips@oss.sgi.com
Subject: Corrupted symbols for MIPS debugging...
From: "Steven J. Hill" <sjhill@cotw.com>
Date: Thu, 13 Sep 2001 14:42:33 -0500
Reply-to: sjhill@cotw.com
Sender: owner-linux-mips@oss.sgi.com
Greetings.

I am currently working with the Insight as well as the
command line driven GDB for remotely debugging my MIPS
kernel (using KGDB of course). Here are the tools used
to compile, link, etc.:

    binutils-2.11.90.0.31 (HJLu patches applied)
    gcc-3.0.1 (stock)
    glibc-2.3.3 (minor build patches)
    linux-kernel-2.4.5 (OSS)
    Insight debugger (20010910-cvs)
    gdb-5.1 (20010913-cvs)

I have breakpoints set at the 'sys_create_module'
and 'sys_init_module' functions in the kernel. Observe
the output below:

--------------------------------------------------------------------
(gdb) target remote /dev/ttyS1
Remote debugging using /dev/ttyS1
0x80012828 in breakinst () at af_packet.c:1879
1879            sock_unregister(PF_PACKET);
(gdb) bt
#0  0x80012828 in breakinst () at af_packet.c:1879
#1  0x8001a0d4 in sys_create_module (name_user=0x10001dc8 "cfi_probe", 
    size=8176) at module.c:305
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x80012828 in breakinst () at af_packet.c:1879
1879            sock_unregister(PF_PACKET);
(gdb) bt
#0  0x80012828 in breakinst () at af_packet.c:1879
#1  0x8001a2c0 in sys_init_module (name_user=0x10001dc8 "cfi_probe", 
    mod_user=0x1002eed0) at module.c:363
--------------------------------------------------------------------

The address 0x80012828 is clearly not in af_packet.c. Herein
is the problem. I have looked at various output with objdump
and nm, but am not getting any clues as to why the symbols
are corrupted. Below is the compile and final link line for
the kernel:

--------------------------------------------------------------------
mipsel-linux-gcc -I /opt/mipskern/include/asm/gcc -D__KERNEL__
-I/opt/mipskern/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-fno-strict-aliasing -g -G 0 -mno-abicalls -fno-pic -mcpu=r5000 -mips2
-Wa,--trap -pipe   -c -o init/main.o init/main.c

mipsel-linux-ld -G 0 -static -T arch/mips/ld.script -Ttext 0x80001000
arch/mips/kernel/head.o arch/mips/kernel/init_task.o init/main.o init/version.o
\
        --start-group \
        arch/mips/kernel/kernel.o arch/mips/mm/mm.o kernel/kernel.o mm/mm.o
fs/fs.o ipc/ipc.o arch/mips/math-emu/fpu_emulator.o \
         drivers/char/char.o drivers/block/block.o drivers/misc/misc.o
drivers/net/net.o drivers/media/media.o drivers/ide/idedriver.o
drivers/pci/driver.o drivers/video/video.o drivers/usb/usbdrv.o \
        net/network.o \
        arch/mips/lib/lib.a /opt/mips/settop/lib/lib.a arch/mips/brcm/brcm.a \
        --end-group \
        -o vmlinux
--------------------------------------------------------------------

Does anyone have some insight (no pun intended) as to what is
wrong here. Thanks everyone.

-Steve

-- 
 Steven J. Hill - Embedded SW Engineer

<Prev in Thread] Current Thread [Next in Thread>