Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Unified Diff: tools/relocation_packer/src/packer.h

Issue 410933004: Extend relocation packing to cover arm64. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to master Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/relocation_packer/src/main.cc ('k') | tools/relocation_packer/src/packer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/relocation_packer/src/packer.h
diff --git a/tools/relocation_packer/src/packer.h b/tools/relocation_packer/src/packer.h
index 21e4de1a32e5e3d5f08496ea974b010bd8d52bda..db09ce8cc22f6ed6055a0916c80f9ed494724a67 100644
--- a/tools/relocation_packer/src/packer.h
+++ b/tools/relocation_packer/src/packer.h
@@ -2,21 +2,44 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Pack ARM relative relocations into a more compact form.
+// Pack relative relocations into a more compact form.
+//
+//
+// For relative relocations without addends (32 bit platforms)
+// -----------------------------------------------------------
//
// Applies two packing strategies. The first is run-length encoding, which
-// turns a large set of ARM relative relocations into a much smaller set
+// turns a large set of relative relocations into a much smaller set
// of delta-count pairs, prefixed with a two-word header comprising the
// count of pairs and the initial relocation offset. The second is LEB128
-// encoding, which compacts the result of run-length encoding.
+// encoding, which compresses the result of run-length encoding.
//
// Once packed, data is prefixed by an identifier that allows for any later
// versioning of packing strategies.
//
-// A complete packed stream might look something like:
+// A complete packed stream of relocations without addends might look
+// something like:
//
// "APR1" pairs init_offset count1 delta1 count2 delta2 ...
// 41505231 f2b003 b08ac716 e001 04 01 10 ...
+//
+//
+// For relative relocations with addends (64 bit platforms)
+// --------------------------------------------------------
+//
+// Applies two packing strategies. The first is delta encoding, which
+// turns a large set of relative relocations into a smaller set
+// of offset and addend delta pairs, prefixed with a header indicating the
+// count of pairs. The second is signed LEB128 encoding, which compacts
+// the result of delta encoding.
+//
+// Once packed, data is prefixed by an identifier that allows for any later
+// versioning of packing strategies.
+//
+// A complete packed stream might look something like:
+//
+// "APA1" pairs offset_d1 addend_d1 offset_d2 addend_d2 ...
+// 41505232 f2b018 04 28 08 9f01 ...
#ifndef TOOLS_RELOCATION_PACKER_SRC_PACKER_H_
#define TOOLS_RELOCATION_PACKER_SRC_PACKER_H_
@@ -29,21 +52,25 @@
namespace relocation_packer {
-// A RelocationPacker packs vectors of ARM relative relocations into more
+// A RelocationPacker packs vectors of relative relocations into more
// compact forms, and unpacks them to reproduce the pre-packed data.
class RelocationPacker {
public:
- // Pack ARM relative relocations into a more compact form.
- // |relocations| is a vector of ARM relative relocation structs.
+ // Pack relative relocations into a more compact form.
+ // |relocations| is a vector of relative relocation structs.
// |packed| is the vector of packed bytes into which relocations are packed.
static void PackRelativeRelocations(const std::vector<ELF::Rel>& relocations,
std::vector<uint8_t>* packed);
+ static void PackRelativeRelocations(const std::vector<ELF::Rela>& relocations,
+ std::vector<uint8_t>* packed);
- // Unpack ARM relative relocations from their more compact form.
+ // Unpack relative relocations from their more compact form.
// |packed| is the vector of packed relocations.
- // |relocations| is a vector of unpacked ARM relative relocation structs.
+ // |relocations| is a vector of unpacked relative relocation structs.
static void UnpackRelativeRelocations(const std::vector<uint8_t>& packed,
std::vector<ELF::Rel>* relocations);
+ static void UnpackRelativeRelocations(const std::vector<uint8_t>& packed,
+ std::vector<ELF::Rela>* relocations);
};
} // namespace relocation_packer
« no previous file with comments | « tools/relocation_packer/src/main.cc ('k') | tools/relocation_packer/src/packer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698