4.22 Inline functions and removal of unused out-of-line functions at link time

The linker cannot remove unused out-of-line functions from an object unless you place the unused out-of-line functions in their own sections.

Use one of the following methods to place unused out-of-line functions in their own sections:
  • --split_sections.
  • __attribute__((section("name"))).
  • #pragma arm section [section_type_list].
  • Linker feedback.
--feedback is typically an easier method of enabling unused function removal.
Related concepts
4.19 Inline functions
4.20 Compiler decisions on function inlining
4.21 Automatic function inlining and static functions
4.23 Automatic function inlining and multifile compilation
4.25 Compiler modes and inline functions
4.26 Inline functions in C++ and C90 mode
4.27 Inline functions in C99 mode
4.28 Inline functions and debugging
Related reference
4.24 Restriction on overriding compiler decisions about function inlining
7.60 --feedback=filename
7.144 --split_sections
9.64 __attribute__((section("name"))) variable attribute
9.74 #pragma arm section [section_type_list]
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.