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

Unified Diff: tools/relocation_packer/test_data/elf_file_unittest_relocs.cc

Issue 310483003: Add a host tool to pack R_ARM_RELATIVE relocations in libchrome.<ver>.so. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove binary test data files, dcommit separately. Created 6 years, 6 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/run_length_encoder_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/relocation_packer/test_data/elf_file_unittest_relocs.cc
diff --git a/tools/relocation_packer/test_data/elf_file_unittest_relocs.cc b/tools/relocation_packer/test_data/elf_file_unittest_relocs.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f925fa13356ffd1f3fa38a0d3d0c86026e885b54
--- /dev/null
+++ b/tools/relocation_packer/test_data/elf_file_unittest_relocs.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Test data for packing/unpacking. When compiled, creates a run of
+// relative relocations.
+//
+// #!/bin/bash
+//
+// # Compile as an arm shared library.
+// /usr/bin/arm-linux-gnueabi-g++ -shared -o /tmp/testdata.so \
+// elf_file_unittest_relocs.cc
+//
+// # Add a new null .android.rel.dyn section, needed for packing.
+// echo 'NULL' >/tmp/small
+// /usr/bin/arm-linux-gnueabi-objcopy \
+// --add-section .android.rel.dyn=/tmp/small /tmp/testdata.so
+//
+// # Create packed and unpacked reference files.
+// packer="../../../out_android/Debug/relocation_packer"
+// cp /tmp/testdata.so elf_file_unittest_relocs_packed.so
+// $packer elf_file_unittest_relocs_packed.so
+// cp elf_file_unittest_relocs_packed.so elf_file_unittest_relocs.so
+// $packer -u elf_file_unittest_relocs.so
+//
+// # Clean up.
+// rm /tmp/testdata.so /tmp/small
+
+const int i = 0;
+
+const void* pointer_0 = &i;
+const void* pointer_1 = &i;
+const void* pointer_2 = &i;
+const void* pointer_3 = &i;
+const void* pointer_4 = &i;
+const void* pointer_5 = &i;
+const void* pointer_6 = &i;
+const void* pointer_7 = &i;
+const void* pointer_8 = &i;
+const void* pointer_9 = &i;
« no previous file with comments | « tools/relocation_packer/src/run_length_encoder_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698