diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/Archive/7z/7zUpdate.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CPP/7zip/Archive/7z/7zUpdate.cpp b/CPP/7zip/Archive/7z/7zUpdate.cpp index d374a00..c8c5d26 100644 --- a/CPP/7zip/Archive/7z/7zUpdate.cpp +++ b/CPP/7zip/Archive/7z/7zUpdate.cpp | |||
@@ -219,6 +219,14 @@ static int Parse_EXE(const Byte *buf, size_t size, CFilterMode *filterMode) | |||
219 | } | 219 | } |
220 | 220 | ||
221 | 221 | ||
222 | /* | ||
223 | Filters don't improve the compression ratio for relocatable object files (".o"). | ||
224 | But we can get compression ratio gain, if we compress object | ||
225 | files and executables in same solid block. | ||
226 | So we use filters for relocatable object files (".o"): | ||
227 | */ | ||
228 | // #define Z7_7Z_CREATE_ARC_DISABLE_FILTER_FOR_OBJ | ||
229 | |||
222 | /* ---------- ELF ---------- */ | 230 | /* ---------- ELF ---------- */ |
223 | 231 | ||
224 | #define ELF_SIG 0x464C457F | 232 | #define ELF_SIG 0x464C457F |
@@ -258,6 +266,12 @@ static int Parse_ELF(const Byte *buf, size_t size, CFilterMode *filterMode) | |||
258 | default: return 0; | 266 | default: return 0; |
259 | } | 267 | } |
260 | 268 | ||
269 | #ifdef Z7_7Z_CREATE_ARC_DISABLE_FILTER_FOR_OBJ | ||
270 | #define ELF_ET_REL 1 | ||
271 | if (Get16(buf + 0x10, be) == ELF_ET_REL) | ||
272 | return 0; | ||
273 | #endif | ||
274 | |||
261 | switch (Get16(buf + 0x12, be)) | 275 | switch (Get16(buf + 0x12, be)) |
262 | { | 276 | { |
263 | case 3: | 277 | case 3: |
@@ -318,6 +332,12 @@ static unsigned Parse_MACH(const Byte *buf, size_t size, CFilterMode *filterMode | |||
318 | default: return 0; | 332 | default: return 0; |
319 | } | 333 | } |
320 | 334 | ||
335 | #ifdef Z7_7Z_CREATE_ARC_DISABLE_FILTER_FOR_OBJ | ||
336 | #define MACH_TYPE_OBJECT 1 | ||
337 | if (Get32(buf + 0xC, be) == MACH_TYPE_OBJECT) | ||
338 | return 0; | ||
339 | #endif | ||
340 | |||
321 | switch (Get32(buf + 4, be)) | 341 | switch (Get32(buf + 4, be)) |
322 | { | 342 | { |
323 | case MACH_MACHINE_386: | 343 | case MACH_MACHINE_386: |