2007-12-08 22:42:33 +00:00
|
|
|
/**
|
2008-12-31 14:29:39 +00:00
|
|
|
* \file lzma/bcj.h
|
|
|
|
* \brief Branch/Call/Jump conversion filters
|
2022-12-21 15:59:43 +00:00
|
|
|
* \note Never include this file directly. Use <lzma.h> instead.
|
2009-04-13 08:27:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Author: Lasse Collin
|
2007-12-08 22:42:33 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LZMA_H_INTERNAL
|
|
|
|
# error Never include this file directly. Use <lzma.h> instead.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2008-08-28 19:53:15 +00:00
|
|
|
/* Filter IDs for lzma_filter.id */
|
2007-12-08 22:42:33 +00:00
|
|
|
|
2023-02-16 16:44:44 +00:00
|
|
|
/**
|
2023-02-16 16:54:33 +00:00
|
|
|
* \brief Filter for x86 binaries
|
2023-02-16 16:44:44 +00:00
|
|
|
*/
|
2007-12-08 22:42:33 +00:00
|
|
|
#define LZMA_FILTER_X86 LZMA_VLI_C(0x04)
|
|
|
|
|
2023-02-16 16:44:44 +00:00
|
|
|
/**
|
2023-02-16 16:54:33 +00:00
|
|
|
* \brief Filter for Big endian PowerPC binaries
|
2023-02-16 16:44:44 +00:00
|
|
|
*/
|
2007-12-08 22:42:33 +00:00
|
|
|
#define LZMA_FILTER_POWERPC LZMA_VLI_C(0x05)
|
|
|
|
|
2023-02-16 16:44:44 +00:00
|
|
|
/**
|
2023-02-16 16:54:33 +00:00
|
|
|
* \brief Filter for IA-64 (Itanium) binaries
|
2023-02-16 16:44:44 +00:00
|
|
|
*/
|
2007-12-08 22:42:33 +00:00
|
|
|
#define LZMA_FILTER_IA64 LZMA_VLI_C(0x06)
|
|
|
|
|
2023-02-16 16:44:44 +00:00
|
|
|
/**
|
2023-02-16 16:54:33 +00:00
|
|
|
* \brief Filter for ARM binaries
|
2023-02-16 16:44:44 +00:00
|
|
|
*/
|
2007-12-08 22:42:33 +00:00
|
|
|
#define LZMA_FILTER_ARM LZMA_VLI_C(0x07)
|
|
|
|
|
2023-02-16 16:44:44 +00:00
|
|
|
/**
|
2023-02-16 16:54:33 +00:00
|
|
|
* \brief Filter for ARM-Thumb binaries
|
2023-02-16 16:44:44 +00:00
|
|
|
*/
|
2007-12-08 22:42:33 +00:00
|
|
|
#define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08)
|
|
|
|
|
2023-02-16 16:44:44 +00:00
|
|
|
/**
|
2023-02-16 16:54:33 +00:00
|
|
|
* \brief Filter for SPARC binaries
|
2023-02-16 16:44:44 +00:00
|
|
|
*/
|
2007-12-08 22:42:33 +00:00
|
|
|
#define LZMA_FILTER_SPARC LZMA_VLI_C(0x09)
|
|
|
|
|
2023-02-16 16:44:44 +00:00
|
|
|
/**
|
2023-02-16 16:54:33 +00:00
|
|
|
* \brief Filter for ARM64 binaries
|
2023-02-16 16:44:44 +00:00
|
|
|
*/
|
2022-12-11 19:13:06 +00:00
|
|
|
#define LZMA_FILTER_ARM64 LZMA_VLI_C(0x0A)
|
2023-02-16 16:44:44 +00:00
|
|
|
|
2024-01-22 15:33:39 +00:00
|
|
|
/**
|
|
|
|
* \brief Filter for RISC-V binaries
|
|
|
|
*/
|
|
|
|
#define LZMA_FILTER_RISCV LZMA_VLI_C(0x0B)
|
|
|
|
|
2007-12-08 22:42:33 +00:00
|
|
|
|
|
|
|
/**
|
2023-03-16 14:07:15 +00:00
|
|
|
* \brief Options for BCJ filters
|
2007-12-08 22:42:33 +00:00
|
|
|
*
|
2008-12-31 14:29:39 +00:00
|
|
|
* The BCJ filters never change the size of the data. Specifying options
|
|
|
|
* for them is optional: if pointer to options is NULL, default value is
|
|
|
|
* used. You probably never need to specify options to BCJ filters, so just
|
|
|
|
* set the options pointer to NULL and be happy.
|
2007-12-08 22:42:33 +00:00
|
|
|
*
|
|
|
|
* If options with non-default values have been specified when encoding,
|
|
|
|
* the same options must also be specified when decoding.
|
2008-01-25 22:25:34 +00:00
|
|
|
*
|
2008-12-31 14:29:39 +00:00
|
|
|
* \note At the moment, none of the BCJ filters support
|
2008-01-25 22:25:34 +00:00
|
|
|
* LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified,
|
2008-09-13 09:10:43 +00:00
|
|
|
* LZMA_OPTIONS_ERROR will be returned. If there is need,
|
2008-01-25 22:25:34 +00:00
|
|
|
* partial support for LZMA_SYNC_FLUSH can be added in future.
|
|
|
|
* Partial means that flushing would be possible only at
|
|
|
|
* offsets that are multiple of 2, 4, or 16 depending on
|
|
|
|
* the filter, except x86 which cannot be made to support
|
|
|
|
* LZMA_SYNC_FLUSH predictably.
|
2007-12-08 22:42:33 +00:00
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
/**
|
2008-12-31 14:29:39 +00:00
|
|
|
* \brief Start offset for conversions
|
2007-12-08 22:42:33 +00:00
|
|
|
*
|
|
|
|
* This setting is useful only when the same filter is used
|
|
|
|
* _separately_ for multiple sections of the same executable file,
|
|
|
|
* and the sections contain cross-section branch/call/jump
|
2010-02-12 11:16:15 +00:00
|
|
|
* instructions. In that case it is beneficial to set the start
|
2007-12-08 22:42:33 +00:00
|
|
|
* offset of the non-first sections so that the relative addresses
|
|
|
|
* of the cross-section branch/call/jump instructions will use the
|
|
|
|
* same absolute addresses as in the first section.
|
|
|
|
*
|
2008-12-15 17:39:13 +00:00
|
|
|
* When the pointer to options is NULL, the default value (zero)
|
|
|
|
* is used.
|
2007-12-08 22:42:33 +00:00
|
|
|
*/
|
|
|
|
uint32_t start_offset;
|
|
|
|
|
2008-12-31 14:29:39 +00:00
|
|
|
} lzma_options_bcj;
|