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

Unified Diff: tools/relocation_packer/src/relocation_packer_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: Created 6 years, 7 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/relocation_packer_elf_file_unittest_relocs.cc
diff --git a/tools/relocation_packer/src/relocation_packer_elf_file_unittest_relocs.cc b/tools/relocation_packer/src/relocation_packer_elf_file_unittest_relocs.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0a87aba9c0985986d2e135aee456e0fe994952e5
--- /dev/null
+++ b/tools/relocation_packer/src/relocation_packer_elf_file_unittest_relocs.cc
@@ -0,0 +1,36 @@
+// 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 short vtable
+// that is represented as relative relocations in a shared library.
+//
+// #!/bin/bash
+// # Compile as an arm shared library.
+// /usr/bin/arm-linux-gnueabi-g++ -shared -o \
+// relocation_packer_elf_file_unittest_relocs.so \
+// relocation_packer_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 \
+// relocation_packer_elf_file_unittest_relocs.so
+//
+// # Convert into C/C++ include file style for unit testing convenience.
+// /usr/bin/xxd -i relocation_packer_elf_file_unittest_relocs.so \
+// > relocation_packer_elf_file_unittest_relocs.so.h
+//
+// # Cleanup.
+// rm relocation_packer_elf_file_unittest_relocs.so
+
+struct Foo {
rmcilroy 2014/06/02 15:16:35 How about putting this in a data directory (along
+ virtual int f1(); virtual int f2();
+};
+struct Bar : Foo {
+ int f1() { return 1; };
+ int f2() { return 2; };
+};
+void Bas() {
+ Bar bar; bar.f1(); bar.f2();
+}

Powered by Google App Engine
This is Rietveld 408576698