Symbol address quirkiness

Shaun Jackman sjackman@gmail.com
Mon Jun 26 01:53:00 GMT 2006


I used `add-symbol-file' and specified an offset and noticed two
quirky behaviours. Although the offset is added to the .text segment,
it doesn't seem to be added to the .data segment. Also, in the example
below, the symbol _impure_ptr moves mid-flight! If you need more
information to trouble-shoot this, I'll by happy to provide.

Cheers,
Shaun

$ arm-elf-gdb
...
(gdb) symbol-file
Discard symbol table? (y or n) y
Hardware assisted breakpoint 2 at 0x20648e4
Error in re-setting breakpoint 3:
No symbol table is loaded.  Use the "file" command.
No symbol file now.
(gdb) add-symbol-file ~/work/pathway/user/pic/hello 0x20648e0
add symbol table from file "/home/sjackman/work/pathway/user/pic/hello" at
        .text_addr = 0x20648e0
(y or n) y
Reading symbols from /home/sjackman/work/pathway/user/pic/hello...done.

Hardware assisted breakpoint 2 at 0x20648e4: file
../../../../../../libgloss/arm/linux-crt0.S, line 14.
(gdb) i addr _impure_ptr
Symbol "_impure_ptr" is static storage at address 0x227c.
(gdb) i addr impure_data
Symbol "impure_data" is static storage at address 0x4460.
(gdb) i addr _impure_ptr
Symbol "_impure_ptr" is static storage at address 0x44f8.
(gdb) i addr impure_data
Symbol "impure_data" is static storage at address 0x4460.
(gdb) i addr _impure_ptr
Symbol "_impure_ptr" is static storage at address 0x44f8.
(gdb) show version
GNU gdb 6.5.50.20060527-cvs
$ arm-elf-nm -S hello |grep impure
00002680 00000004 D _global_impure_ptr
0000227c 00000004 D _impure_ptr
00002280 00000400 d impure_data



More information about the Gdb mailing list