OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The main idea in Courgette is to do patching *under a tranformation*. The | 5 // The main idea in Courgette is to do patching *under a tranformation*. The |
6 // input is transformed into a new representation, patching occurs in the new | 6 // input is transformed into a new representation, patching occurs in the new |
7 // repesentation, and then the tranform is reversed to get the patched data. | 7 // repesentation, and then the tranform is reversed to get the patched data. |
8 // | 8 // |
9 // The idea is applied to pieces (or 'elements') of the whole (or 'ensemble'). | 9 // The idea is applied to pieces (or 'elements') of the whole (or 'ensemble'). |
10 // Each of the elements has to go through the same set of steps in lock-step. | 10 // Each of the elements has to go through the same set of steps in lock-step. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 break; | 69 break; |
70 case EXE_WIN_32_X86: { | 70 case EXE_WIN_32_X86: { |
71 TransformationPatchGenerator* generator = | 71 TransformationPatchGenerator* generator = |
72 new PatchGeneratorX86_32( | 72 new PatchGeneratorX86_32( |
73 old_element, | 73 old_element, |
74 new_element, | 74 new_element, |
75 new PatcherX86_32(old_element->region()), | 75 new PatcherX86_32(old_element->region()), |
76 EXE_WIN_32_X86); | 76 EXE_WIN_32_X86); |
77 return generator; | 77 return generator; |
78 } | 78 } |
| 79 case EXE_ELF_32_X86: { |
| 80 TransformationPatchGenerator* generator = |
| 81 new PatchGeneratorX86_32( |
| 82 old_element, |
| 83 new_element, |
| 84 new PatcherX86_32(old_element->region()), |
| 85 EXE_ELF_32_X86); |
| 86 return generator; |
| 87 } |
79 } | 88 } |
80 | 89 |
81 LOG(WARNING) << "Unexpected Element::Kind " << old_element->kind(); | 90 LOG(WARNING) << "Unexpected Element::Kind " << old_element->kind(); |
82 return NULL; | 91 return NULL; |
83 } | 92 } |
84 | 93 |
85 // Checks to see if the proposed comparison is 'unsafe'. Sometimes one element | 94 // Checks to see if the proposed comparison is 'unsafe'. Sometimes one element |
86 // from 'old' is matched as the closest element to multiple elements from 'new'. | 95 // from 'old' is matched as the closest element to multiple elements from 'new'. |
87 // Each time this happens, the old element is transformed and serialized. This | 96 // Each time this happens, the old element is transformed and serialized. This |
88 // is a problem when the old element is huge compared with the new element | 97 // is a problem when the old element is huge compared with the new element |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 return C_STREAM_ERROR; | 428 return C_STREAM_ERROR; |
420 } | 429 } |
421 | 430 |
422 VLOG(1) << "done GenerateEnsemblePatch " | 431 VLOG(1) << "done GenerateEnsemblePatch " |
423 << (base::Time::Now() - start_time).InSecondsF() << "s"; | 432 << (base::Time::Now() - start_time).InSecondsF() << "s"; |
424 | 433 |
425 return C_OK; | 434 return C_OK; |
426 } | 435 } |
427 | 436 |
428 } // namespace | 437 } // namespace |
OLD | NEW |