How compression is applied
The linker applies compression depending on the compression type specified, and might apply additional compression on repeated phrases.
Run-length compression encodes data as non-repeated bytes and repeated zero-bytes. Non-repeated bytes are output unchanged, followed by a count of zero-bytes.
Limpel-Ziv 1977 (LZ77) compression keeps track of the last n bytes of data seen. When a phrase is encountered that has already been seen, it outputs a pair of values corresponding to:
The position of the phrase in the previously-seen buffer of data.
The length of the phrase.