XZ Utils 5.3.4alpha
|
Filter for ARM64 binaries. More...
#include "simple_private.h"
Functions | |
static uint32_t | arm64_conv (uint32_t src, uint32_t pc, uint32_t mask, bool is_encoder) |
static size_t | arm64_code (void *simple lzma_attribute((__unused__)), uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size) |
static lzma_ret | arm64_coder_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters, bool is_encoder) |
Filter for ARM64 binaries.
This converts ARM64 relative addresses in the BL and ADRP immediates to absolute values to increase redundancy of ARM64 code.
Unlike the older BCJ filters, this handles zeros specially. This way the filter won't be counterproductive on Linux kernel modules, object files, and static libraries where the immediates are all zeros (to be filled later by a linker). Usually this has no downsides but with bad luck it can reduce the effectiveness of the filter and trying a different start offset can mitigate the problem.
Converting B or ADR instructions was also tested but it's not useful. A majority of the jumps for the B instruction are very small (+/- 0xFF). These are typical for loops and if-statements. Encoding them to their absolute address reduces redundancy since many of the small relative jump values are repeated, but very few of the absolute addresses are.