5.2. Image sizes and stripping debug data

Both the GNU and ARM toolchains add a significant amount of information to an image that is generally only of use for debugging.For production embedded Linux systems, it is likely that you would want to strip the debugging data from your applications and shared libraries. With RVCT, this can be removed using the ‑‑no_debug switch either at the link stage or by running fromelf on the linked image. In addition, you can use fromelf on the linked image to remove debug information and the ".comment" sections from the file. For example:

fromelf --no_debug --no_comment_section --elf -o stripped.axf image.axf

The example makefiles perform the above fromelf step by default. If you wish to retain the debug tables and the ".comment" section you can define the ENABLE_DEBUG variable.

In addition, the data sizes in RVCT images can be slightly larger than those in GNU images. This is typically because some ZI data (BSS) is moved into the RW data area for performance reasons on bare-metal systems. You can move this data to ZI (also called BSS) sections using the compiler switch ‑‑bss_threshold=0.

Copyright © 2005-2006. All rights reserved.DAI0150B