Keil™, An ARM® Company

RealView Linker and Utilities Guide

Controlling debug information

2.2.7. Controlling debug information

These options control debug information in the image:

‑‑[no_]debug

Use ‑‑debug to include debug information in the output file. The debug information includes debug input sections and the symbol and string table. This is the default.

Use ‑‑no_debug to exclude debug information from the output file. The ELF image is smaller, but you cannot debug it at the source level. The linker discards any debug input section it finds in the input objects and library members, and does not include the symbol and string table in the image. This only affects the image size as loaded into the debugger. It has no effect on the size of any resulting binary image that is downloaded to the target.

If you are creating a partially-linked object rather than an image, the linker discards the debug input sections it finds in the input objects, but does produce the symbol and string table in the partially-linked object.

Note

Do not use ‑‑no_debug if a fromelf ‑‑fieldoffsets step is required. If your image is produced without debug information, fromelf cannot:

  • translate the image into other file formats

  • produce a meaningful disassembly listing.

‑‑[no_]bestdebug

Selects between linking for smallest code/data size or best debug illusion. Input objects might contain comdat groups, but these might not be identical across all input objects because of differences. For example, inlining.

‑‑no_bestdebug is the default. This ensures that the code and data of the final image are the same regardless of whether you compile for debug or not. The smallest comdat groups are selected when linking, at the expense of a possibly slightly poorer debug illusion.

Use ‑‑bestdebug to select comdat groups with the best debug view. Be aware that the code and data of the final image might not be the same when building with or without debug.

See Common group or section elimination for more information.

‑‑[no_]compress_debug

‑‑compress_debug suggests to the linker to compress .debug_* sections, if it is sensible to do so. This removes some redundancy and reduce debug table size. Using ‑‑compress_debug can significantly increase the time required to link an image. Debug compression can only be performed on DWARF3 debug data, not DWARF2.

‑‑no_compress_debug is the default.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0377A