diff options
| author | 2018-01-18 17:29:15 +0000 | |
|---|---|---|
| committer | 2018-01-18 17:29:15 +0000 | |
| commit | 5db5d67e5f88c5762f02651cb6d30ce675721c87 (patch) | |
| tree | 8ce9eecb4262cadcb5b367ec8cb79cd11d6ec103 /patchoat/patchoat.h | |
| parent | 9ee6fe008dcbb3f1a5373bb587d16f115883183a (diff) | |
| parent | 3856af0d6e09525a4e774bec729dd781a72d5549 (diff) | |
Merge "Reland: Enable patchoat to write image relocation files"
Diffstat (limited to 'patchoat/patchoat.h')
| -rw-r--r-- | patchoat/patchoat.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/patchoat/patchoat.h b/patchoat/patchoat.h index 83516845d8..1033a2e5e1 100644 --- a/patchoat/patchoat.h +++ b/patchoat/patchoat.h @@ -44,12 +44,25 @@ class Class; class PatchOat { public: + // Relocates the provided image by the specified offset. If output_image_directory is non-empty, + // outputs the relocated image into that directory. If output_image_relocation_directory is + // non-empty, outputs image relocation files (see GeneratePatch) into that directory. static bool Patch(const std::string& image_location, off_t delta, - const std::string& output_directory, + const std::string& output_image_directory, + const std::string& output_image_relocation_directory, InstructionSet isa, TimingLogger* timings); + // Generates a patch which can be used to efficiently relocate the original file or to check that + // a relocated file matches the original. The patch is generated from the difference of the + // |original| and the already |relocated| image, and written to |output| in the form of unsigned + // LEB128 for each relocation position. + static bool GeneratePatch(const MemMap& original, + const MemMap& relocated, + std::vector<uint8_t>* output, + std::string* error_msg); + ~PatchOat() {} PatchOat(PatchOat&&) = default; |