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 common groups or sections
4.2 Elimination of common groups or sections
The linker can detect multiple copies of groups and sections, and discard the additional copies.
The ARM® compiler generates complete objects for linking. Therefore:
When these functions are declared in a common header file, the functions might be defined many times in separate objects that are subsequently linked together. To eliminate duplicates, the compiler compiles these functions into separate instances of common code sections or groups.
It is possible that the separate instances of common code sections, or groups, are not identical. Some of the copies, for example, might be found in a library that has been built with different, but compatible, build options, different optimization, or debug options.
If the copies are not identical, armlink retains the best available variant of each common code section, or group, based on the attributes of the input objects. armlink discards the rest.
If the copies are identical, armlink retains the first section or group located.
You control this optimization with the following linker options:
of your data.