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

Unified Diff: third_party/android_platform/bionic/tools/relocation_packer/src/packer.h

Issue 1027823002: Port Android relocation packer to chromium build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed two nugatory files Created 5 years, 9 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
Index: third_party/android_platform/bionic/tools/relocation_packer/src/packer.h
diff --git a/tools/relocation_packer/src/packer.h b/third_party/android_platform/bionic/tools/relocation_packer/src/packer.h
similarity index 70%
copy from tools/relocation_packer/src/packer.h
copy to third_party/android_platform/bionic/tools/relocation_packer/src/packer.h
index db09ce8cc22f6ed6055a0916c80f9ed494724a67..8a57e623b0d67b91d482b75343f15198a37f21d1 100644
--- a/tools/relocation_packer/src/packer.h
+++ b/third_party/android_platform/bionic/tools/relocation_packer/src/packer.h
@@ -48,29 +48,25 @@
#include <vector>
#include "elf.h"
-#include "elf_traits.h"
namespace relocation_packer {
-// A RelocationPacker packs vectors of relative relocations into more
+// A RelocationPacker packs vectors of relocations into more
// compact forms, and unpacks them to reproduce the pre-packed data.
+template <typename ELF>
class RelocationPacker {
public:
- // Pack relative relocations into a more compact form.
- // |relocations| is a vector of relative relocation structs.
+ // Pack relocations into a more compact form.
+ // |relocations| is a vector of 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);
+ static void PackRelocations(const std::vector<typename ELF::Rela>& relocations,
+ std::vector<uint8_t>* packed);
- // Unpack relative relocations from their more compact form.
+ // Unpack relocations from their more compact form.
// |packed| is the vector of packed relocations.
- // |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);
+ // |relocations| is a vector of unpacked relocation structs.
+ static void UnpackRelocations(const std::vector<uint8_t>& packed,
+ std::vector<typename ELF::Rela>* relocations);
};
} // namespace relocation_packer

Powered by Google App Engine
This is Rietveld 408576698