Problem using CodeSourcery 2010.9-50 ARM GDB to debug U-boot w/BDI

Peter Barada
Mon Jan 17 19:35:00 GMT 2011

I'm using the latest ARM GDB from CodeSourcery with a BDI to debug
U-Boot 2010.12-rc3 on my hardware and I have a problem trying to access
symbols in .bss after loading the symbol table to the relocated
address.  Apparrenlty GDB is translating symbols in .text but not symbols
in .bss:

Current directory is
GNU gdb (Sourcery G++ Lite 2010.09-50)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
For bug reporting instructions, please see:
(gdb) pwd
Working directory
(gdb) add-symbol-file u-boot 0x8ff74000
add symbol table from file "u-boot" at
      .text_addr = 0x8ff74000
(y or n) y
Reading symbols from
(gdb) p&NS16550_getc
$1 = (char (*)(NS16550_t)) 0x8ff91de0<NS16550_getc>
(gdb) p&htab
$2 = (struct hsearch_data *) 0x804783fc
(gdb) tar remote abatron:2001
Remote debugging using abatron:2001
0x8ff91de4 in NS16550_getc (com_port=0x4806a000) at ns16550.c:87
(gdb) info file
Remote serial target in gdb-specific protocol:
Debugging a target over a serial line.
(gdb) p/x ((gd_t*)$r8)->reloc_off
$3 = 0xfb74000
(gdb) p/x ((gd_t*)$r8)->relocaddr
$4 = 0x8ff74000

My version of u-boot is linked at 0x80400000, and the relevant addresses
from the u-boot ELF file are:
8041dde0 T NS16550_getc
804783fc b htab

NS16650_getc has been properly translated from 0x8041dde0 by 0xfb74000
(as the symbol table is loaded at address 0x8ff74000 instead of
0x80400000), but htab has not been translated.

Has anyone seen this type of problem before?  Any suggestions?
Thanks in advance!

Peter Barada

More information about the Gdb mailing list