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
Options available to override the compression algorithm used by the linker
4.7.2 Options available to override the compression algorithm used by the linker
The linker has options to disable compression or to specify a compression algorithm to be used.
You can override the compression algorithm used by the linker by either:
To specify a compression algorithm, use the number of the required compressor on the linker command line, for example:
armlink --datacompressor 2 …
Use the command-line option
armlink --datacompressor list … Num Compression algorithm ======================================================== 0 Run-length encoding 1 Run-length encoding, with LZ77 on small-repeats 2 Complex LZ77 compression
When choosing a compression algorithm be aware that:
The linker prefers compressor 0 or 1 where the data contains mostly zero-bytes (>75%). Compressor 2 is chosen where the data contains few zero-bytes (<10%). If the image is made up only of ARM code, then ARM decompressors are used automatically. If the image contains any Thumb code, Thumb decompressors are used. If there is no clear preference, all compressors are tested to produce the best overall size.
NoteIt is not possible to add your own compressors into the linker. The algorithms that are available, and how the linker chooses to use them, might change in the future.
of your data.