Keil Logo

Technical Support

On-Line Manuals

Compiler User Guide

Preface Overview of the Compiler Getting Started with the Compiler Compiler command-line syntax Compiler command-line options listed by group Default compiler behavior Order of compiler command-line options Using stdin to input source code to the compiler Directing output to stdout Filename suffixes recognized by the compiler Compiler output files Factors influencing how the compiler searches for Compiler command-line options and search paths Compiler search rules and the current place The ARMCC5INC environment variable Code compatibility between separately compiled and Linker feedback during compilation Unused function code Minimizing code size by eliminating unused functio Compilation build time Compilation build time Minimizing compilation build time Minimizing compilation build time with a single ar Effect of --multifile on compilation build time Minimizing compilation build time with parallel ma Compilation build time on Windows Compiler Features Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR Compiler Command-line Options Language Extensions Compiler-specific Features C and C++ Implementation Details What is Semihosting? Via File Syntax Summary Table of GNU Language Extensions Standard C Implementation Definition Standard C++ Implementation Definition C and C++ Compiler Implementation Limits

Unused function code

2.15 Unused function code

Unused function code can unnecessarily increase code size. Feedback from the linker to the compiler can remove unused function code, minimizing code size.

Unused function code might occur in the following situations.
  • Where you have legacy functions that are no longer used in your source code. Rather than manually remove the unused function code from your source code, you can use linker feedback to remove the unused object code automatically from the final image.
  • Where a function is inlined. Where an inlined function is not declared as static, the out-of-line function code is still present in the object file, but there is no longer a call to that code.
In addition, the linker can detect when an ARM function is being called from a Thumb state, and when a Thumb function is being called from an ARM state. You can use feedback from the linker to avoid compiling functions for interworking that are never used in an interworking context.


Reduction of compilation required for interworking is only applicable to ARMv4T architectures. ARMv5T and later processors can interwork without penalty.
The linker option --feedback=filename creates a feedback file, and the --feedback_type option controls the different types of feedback generated.
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.