Keil Logo

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:
  • Using the --datacompressor off option to turn off compression.
  • Specifying a compression algorithm.
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 --datacompressor list to get a list of compression algorithms available in the linker:
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:
  • Compressor 0 performs well on data with large areas of zero-bytes but few nonzero bytes.
  • Compressor 1 performs well on data where the nonzero bytes are repeating.
  • Compressor 2 performs well on data that contains repeated values.
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.

Note

It 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.
Related reference
Non-ConfidentialPDF file icon PDF versionARM DUI0377H
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.