Linker User GuidePreface Overview of the Linker Linking Models Supported by armlink Image Structure and Generation Linker Optimization Features Elimination of common debug sections Elimination of common groups or sections Elimination of unused sections Elimination of unused virtual functions About linker feedback Example of using linker feedback Optimization with RW data compression How the linker chooses a compressor Options available to override the compression algo How compression is applied Considerations when working with RW data compressi Function inlining with the linker Factors that influence function inlining About branches that optimize to a NOP Linker reordering of tail calling sections Restrictions on reordering of tail calling section Linker merging of comment sections Getting Image Details Accessing and Managing Symbols with armlink Scatter-loading Features Scatter File Syntax Linker Command-line Options Linker Steering File Command Reference Via File Syntax
Elimination of unused sections
4.3 Elimination of unused sections
Elimination of unused sections is the most significant optimization on image size that is performed by the linker.
Unused section elimination:
To control this optimization use the
Unused section elimination requires an entry point. Therefore, if there is no entry point specified for an image, use the
An input section is retained in the final image when:
Compilers usually collect functions and data together and emit one section for each category. The linker can only eliminate a section if it is entirely unused.
You can mark a function or variable in source code with the
You can also use the
Related Knowledgebase Articles
of your data.