OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Test data for packing/unpacking. When compiled, creates a run of | 5 // Test data for packing/unpacking. When compiled, creates a run of |
6 // relative relocations. | 6 // relative relocations. |
7 // | 7 // |
8 // #!/bin/bash | 8 // See generate_elf_file_unittest_relocs.sh for instructions on how to build |
9 // | 9 // unit test data from this source file. |
10 // # Compile as an arm shared library. | |
11 // /usr/bin/arm-linux-gnueabi-g++ -shared -o /tmp/testdata.so \ | |
12 // 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 /tmp/testdata.so | |
18 // | |
19 // # Create packed and unpacked reference files. | |
20 // packer="../../../out_android/Debug/relocation_packer" | |
21 // cp /tmp/testdata.so elf_file_unittest_relocs_packed.so | |
22 // $packer elf_file_unittest_relocs_packed.so | |
23 // cp elf_file_unittest_relocs_packed.so elf_file_unittest_relocs.so | |
24 // $packer -u elf_file_unittest_relocs.so | |
25 // | |
26 // # Clean up. | |
27 // rm /tmp/testdata.so /tmp/small | |
28 | 10 |
29 const int i = 0; | 11 const int i = 0; |
30 | 12 |
31 const void* pointer_0 = &i; | 13 const void* pointer_0 = &i; |
32 const void* pointer_1 = &i; | 14 const void* pointer_1 = &i; |
33 const void* pointer_2 = &i; | 15 const void* pointer_2 = &i; |
34 const void* pointer_3 = &i; | 16 const void* pointer_3 = &i; |
35 const void* pointer_4 = &i; | 17 const void* pointer_4 = &i; |
36 const void* pointer_5 = &i; | 18 const void* pointer_5 = &i; |
37 const void* pointer_6 = &i; | 19 const void* pointer_6 = &i; |
(...skipping 16 matching lines...) Expand all Loading... |
54 const void* pointer_23 = &i; | 36 const void* pointer_23 = &i; |
55 const void* pointer_24 = &i; | 37 const void* pointer_24 = &i; |
56 const void* pointer_25 = &i; | 38 const void* pointer_25 = &i; |
57 const void* pointer_26 = &i; | 39 const void* pointer_26 = &i; |
58 const void* pointer_27 = &i; | 40 const void* pointer_27 = &i; |
59 const void* pointer_28 = &i; | 41 const void* pointer_28 = &i; |
60 const void* pointer_29 = &i; | 42 const void* pointer_29 = &i; |
61 const void* pointer_30 = &i; | 43 const void* pointer_30 = &i; |
62 const void* pointer_31 = &i; | 44 const void* pointer_31 = &i; |
63 const void* pointer_32 = &i; | 45 const void* pointer_32 = &i; |
OLD | NEW |