EmbDev.net

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


Author: Tat Wan (Company: Universiti Sains Malaysia) (tcwan)
Posted on:
Attached files:

Rate this post
0 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):
iMac-TCWan:tests tcmac$ arm-none-eabi-gdb tests_rxe.elf
GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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=x86_64-apple-darwin10.4.0 --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
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.
iMac-TCWan:tests tcmac$ arm-none-eabi-gdb tests_rxe.eabi
GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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=x86_64-apple-darwin10.4.0 --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
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:
iMac-TCWan:tests tcmac$ fgrep Disassembly tests_rxe.elf.objdump 
Disassembly of section .rxe_header:
Disassembly of section .vectors:
Disassembly of section .rxe_init:
Disassembly of section .data:
Disassembly of section .text:
Disassembly of section .bss:
Disassembly of section .stack:

arm-none-eabi-objdump -rD of the default linker generated executable is 
as follows:
iMac-TCWan:tests tcmac$ fgrep Disassembly tests_rxe.eabi.objdump 
Disassembly of section .comment:
Disassembly of section .debug_aranges:
Disassembly of section .debug_pubnames:
Disassembly of section .debug_info:
Disassembly of section .debug_abbrev:
Disassembly of section .debug_line:
Disassembly of section .debug_frame:
Disassembly of section .debug_str:
Disassembly of section .debug_loc:
Disassembly of section .debug_pubtypes:
Disassembly of section .debug_ranges:
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?

Author: Andreas B. (Guest)
Posted on:

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

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.

Author: Tat Wan (Company: Universiti Sains Malaysia) (tcwan)
Posted on:

Rate this post
0 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.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.