2007-12-09 00:42:33 +02:00
|
|
|
/**
|
2008-12-31 16:29:39 +02:00
|
|
|
* \file lzma/bcj.h
|
|
|
|
* \brief Branch/Call/Jump conversion filters
|
2007-12-09 00:42:33 +02:00
|
|
|
*
|
|
|
|
* \author Copyright (C) 1999-2006 Igor Pavlov
|
|
|
|
* \author Copyright (C) 2007 Lasse Collin
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LZMA_H_INTERNAL
|
|
|
|
# error Never include this file directly. Use <lzma.h> instead.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2008-08-28 22:53:15 +03:00
|
|
|
/* Filter IDs for lzma_filter.id */
|
2007-12-09 00:42:33 +02:00
|
|
|
|
|
|
|
#define LZMA_FILTER_X86 LZMA_VLI_C(0x04)
|
|
|
|
/**<
|
2008-12-31 16:29:39 +02:00
|
|
|
* Filter for x86 binaries
|
2007-12-09 00:42:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define LZMA_FILTER_POWERPC LZMA_VLI_C(0x05)
|
|
|
|
/**<
|
|
|
|
* Filter for Big endian PowerPC binaries
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define LZMA_FILTER_IA64 LZMA_VLI_C(0x06)
|
|
|
|
/**<
|
|
|
|
* Filter for IA64 (Itanium) binaries.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define LZMA_FILTER_ARM LZMA_VLI_C(0x07)
|
|
|
|
/**<
|
|
|
|
* Filter for ARM binaries.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define LZMA_FILTER_ARMTHUMB LZMA_VLI_C(0x08)
|
|
|
|
/**<
|
|
|
|
* Filter for ARMThumb binaries.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define LZMA_FILTER_SPARC LZMA_VLI_C(0x09)
|
|
|
|
/**<
|
|
|
|
* Filter for SPARC binaries.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-12-31 16:29:39 +02:00
|
|
|
* \brief Options for BCJ filters
|
2007-12-09 00:42:33 +02:00
|
|
|
*
|
2008-12-31 16:29:39 +02: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-09 00:42:33 +02:00
|
|
|
*
|
|
|
|
* If options with non-default values have been specified when encoding,
|
|
|
|
* the same options must also be specified when decoding.
|
2008-01-26 00:25:34 +02:00
|
|
|
*
|
2008-12-31 16:29:39 +02:00
|
|
|
* \note At the moment, none of the BCJ filters support
|
2008-01-26 00:25:34 +02:00
|
|
|
* LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified,
|
2008-09-13 12:10:43 +03:00
|
|
|
* LZMA_OPTIONS_ERROR will be returned. If there is need,
|
2008-01-26 00:25:34 +02: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-09 00:42:33 +02:00
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
/**
|
2008-12-31 16:29:39 +02:00
|
|
|
* \brief Start offset for conversions
|
2007-12-09 00:42:33 +02: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
|
|
|
|
* instructions. In that case it is benefical to set the start
|
|
|
|
* 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 19:39:13 +02:00
|
|
|
* When the pointer to options is NULL, the default value (zero)
|
|
|
|
* is used.
|
2007-12-09 00:42:33 +02:00
|
|
|
*/
|
|
|
|
uint32_t start_offset;
|
|
|
|
|
2008-12-31 16:29:39 +02:00
|
|
|
} lzma_options_bcj;
|