Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Test data for packing/unpacking. When compiled, creates a short vtable | |
| 6 // that is represented as relative relocations in a shared library. | |
| 7 // | |
| 8 // #!/bin/bash | |
| 9 // # Compile as an arm shared library. | |
| 10 // /usr/bin/arm-linux-gnueabi-g++ -shared -o \ | |
| 11 // relocation_packer_elf_file_unittest_relocs.so \ | |
| 12 // relocation_packer_elf_file_unittest_relocs.cc | |
| 13 // | |
| 14 // # Add a new null .android.rel.dyn section, needed for packing. | |
| 15 // echo 'NULL' >/tmp/small | |
| 16 // /usr/bin/arm-linux-gnueabi-objcopy \ | |
| 17 // --add-section .android.rel.dyn=/tmp/small \ | |
| 18 // relocation_packer_elf_file_unittest_relocs.so | |
| 19 // | |
| 20 // # Convert into C/C++ include file style for unit testing convenience. | |
| 21 // /usr/bin/xxd -i relocation_packer_elf_file_unittest_relocs.so \ | |
| 22 // > relocation_packer_elf_file_unittest_relocs.so.h | |
| 23 // | |
| 24 // # Cleanup. | |
| 25 // rm relocation_packer_elf_file_unittest_relocs.so | |
| 26 | |
| 27 struct Foo { | |
|
rmcilroy
2014/06/02 15:16:35
How about putting this in a data directory (along
| |
| 28 virtual int f1(); virtual int f2(); | |
| 29 }; | |
| 30 struct Bar : Foo { | |
| 31 int f1() { return 1; }; | |
| 32 int f2() { return 2; }; | |
| 33 }; | |
| 34 void Bas() { | |
| 35 Bar bar; bar.f1(); bar.f2(); | |
| 36 } | |
| OLD | NEW |