EmbDev.net

Forum: ARM programming with GCC/GNU tools How to generate debug symbols for custom linker file


von Tat W. (Company: Universiti Sains Malaysia) (tcwan)


Attached files:

Rate this post
useful
not useful
Hi,

I'm trying to use a JLink JTAG to develop assembly code for a LEGO 
Mindstorms NXT (Atmel AT91SAM7S256). However, the code base uses a 
custom linker configuration file (attached).

I have two development platforms, Mac OS X and Windows based (Yagarto 
Toolchain + Eclipse + JLink GDB Server)


The problem is that after the code is built and linked, 
arm-none-eabi-gdb will always complain (example taken from Mac OS X 
version, but similar results were obtained in Windows):
1
iMac-TCWan:tests tcmac$ arm-none-eabi-gdb tests_rxe.elf
2
GNU gdb (GDB) 7.1
3
Copyright (C) 2010 Free Software Foundation, Inc.
4
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
5
This is free software: you are free to change and redistribute it.
6
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
7
and "show warranty" for details.
8
This GDB was configured as "--host=x86_64-apple-darwin10.4.0 --target=arm-none-eabi".
9
For bug reporting instructions, please see:
10
<http://www.gnu.org/software/gdb/bugs/>...
11
Reading symbols from /Users/tcmac/gitrepo/nxos-aholler/nxos/systems/tests/tests_rxe.elf...(no debugging symbols found)...done.

I verfied that if I objdump the tests_rxe.elf file, there is a symbol 
table.

Linking with the default linker (i.e., without -T option) generates 
debugging symbols recognized by gdb.
1
iMac-TCWan:tests tcmac$ arm-none-eabi-gdb tests_rxe.eabi
2
GNU gdb (GDB) 7.1
3
Copyright (C) 2010 Free Software Foundation, Inc.
4
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
5
This is free software: you are free to change and redistribute it.
6
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
7
and "show warranty" for details.
8
This GDB was configured as "--host=x86_64-apple-darwin10.4.0 --target=arm-none-eabi".
9
For bug reporting instructions, please see:
10
<http://www.gnu.org/software/gdb/bugs/>...
11
Reading symbols from /Users/tcmac/gitrepo/nxos-aholler/nxos/systems/tests/tests_rxe.eabi...done.

arm-none-eabi-objdump -rD of the custom-linker generated executable is 
as follows:
1
iMac-TCWan:tests tcmac$ fgrep Disassembly tests_rxe.elf.objdump 
2
Disassembly of section .rxe_header:
3
Disassembly of section .vectors:
4
Disassembly of section .rxe_init:
5
Disassembly of section .data:
6
Disassembly of section .text:
7
Disassembly of section .bss:
8
Disassembly of section .stack:

arm-none-eabi-objdump -rD of the default linker generated executable is 
as follows:
1
iMac-TCWan:tests tcmac$ fgrep Disassembly tests_rxe.eabi.objdump 
2
Disassembly of section .comment:
3
Disassembly of section .debug_aranges:
4
Disassembly of section .debug_pubnames:
5
Disassembly of section .debug_info:
6
Disassembly of section .debug_abbrev:
7
Disassembly of section .debug_line:
8
Disassembly of section .debug_frame:
9
Disassembly of section .debug_str:
10
Disassembly of section .debug_loc:
11
Disassembly of section .debug_pubtypes:
12
Disassembly of section .debug_ranges:
13
Disassembly of section .ARM.attributes:

There are no .data, .text, .bss, or .stack sections in this version.

How can I generate the debugging symbols when using a custom linker 
configuration file?

von Andreas B. (Guest)


Rate this post
useful
not useful
1
  /* Discard anything not mapped at this point. */
2
  /DISCARD/ : {
3
    * (*);
4
  }

This part of the linker script discards all sections not referenced in 
the script up to that point and that includes all the debug sections.

I don't know how the code uploader works in your case but it should be 
able to recognize that these sections (and others) do not need to be 
uploaded and ignore them. Try simply removing the lines I quoted.

von Tat W. (Company: Universiti Sains Malaysia) (tcwan)


Rate this post
useful
not useful
Hi Andreas,

You are right. When I removed the "/DISCARD/" directive section, it 
generated the debug symbols. Thank you for the solution.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.