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

Unified Diff: tools/relocation_packer/src/elf_file_unittest.cc

Issue 410933004: Extend relocation packing to cover arm64. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Script 'golden' test data generation 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
Index: tools/relocation_packer/src/elf_file_unittest.cc
diff --git a/tools/relocation_packer/src/elf_file_unittest.cc b/tools/relocation_packer/src/elf_file_unittest.cc
index d84928ea21c245a30d3fd26e690916d870846e0b..37abd0d95d6422a9ba12fc00db24515a4117ec7c 100644
--- a/tools/relocation_packer/src/elf_file_unittest.cc
+++ b/tools/relocation_packer/src/elf_file_unittest.cc
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
#include "debug.h"
+#include "elf_traits.h"
#include "testing/gtest/include/gtest/gtest.h"
// Macro stringification.
@@ -70,8 +71,20 @@ void OpenRelocsTestFile(const char* name, FILE** stream) {
}
void OpenRelocsTestFiles(FILE** relocs_so, FILE** packed_relocs_so) {
- OpenRelocsTestFile("elf_file_unittest_relocs.so", relocs_so);
- OpenRelocsTestFile("elf_file_unittest_relocs_packed.so", packed_relocs_so);
+ const char* arch = NULL;
+ if (ELF::kMachine == EM_ARM) {
+ arch = "arm32";
+ } else if (ELF::kMachine == EM_AARCH64) {
+ arch = "arm64";
+ }
+ ASSERT_FALSE(arch == NULL);
+
+ const std::string base = std::string("elf_file_unittest_relocs_") + arch;
+ const std::string relocs = base + ".so";
+ const std::string packed_relocs = base + "_packed.so";
+
+ OpenRelocsTestFile(relocs.c_str(), relocs_so);
+ OpenRelocsTestFile(packed_relocs.c_str(), packed_relocs_so);
}
void CloseRelocsTestFile(FILE* temporary) {

Powered by Google App Engine
This is Rietveld 408576698