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/relocation_packer.gyp

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/relocation_packer.gyp
diff --git a/tools/relocation_packer/relocation_packer.gyp b/tools/relocation_packer/relocation_packer.gyp
index 893cc4a7063fd8bc4bb6b57c72ab21753cef4cbc..5d1574fd84d9cb80a57a4c435f3f87446865d450 100644
--- a/tools/relocation_packer/relocation_packer.gyp
+++ b/tools/relocation_packer/relocation_packer.gyp
@@ -27,9 +27,11 @@
],
'sources': [
'src/debug.cc',
+ 'src/delta_encoder.cc',
'src/elf_file.cc',
'src/leb128.cc',
'src/packer.cc',
+ 'src/sleb128.cc',
'src/run_length_encoder.cc',
],
},
@@ -67,9 +69,11 @@
],
'sources': [
'src/debug_unittest.cc',
+ 'src/delta_encoder_unittest.cc',
'src/elf_file_unittest.cc',
'src/leb128_unittest.cc',
'src/packer_unittest.cc',
+ 'src/sleb128_unittest.cc',
'src/run_length_encoder_unittest.cc',
'src/run_all_unittests.cc',
],
@@ -77,8 +81,73 @@
{
'destination': '<(INTERMEDIATE_DIR)',
'files': [
- 'test_data/elf_file_unittest_relocs.so',
- 'test_data/elf_file_unittest_relocs_packed.so',
+ 'test_data/elf_file_unittest_relocs_arm32.so',
+ 'test_data/elf_file_unittest_relocs_arm32_packed.so',
+ 'test_data/elf_file_unittest_relocs_arm64.so',
+ 'test_data/elf_file_unittest_relocs_arm64_packed.so',
+ ],
+ },
+ ],
+ },
+
+ # Targets to build test data. These participate only in building test
+ # data for use with elf_file_unittest.cc, and are not part of the main
+ # relocation packer build. Unit test data files are checked in to the
+ # source tree as 'golden' data, and are not generated 'on the fly' by
+ # the build.
+ #
+ # See test_data/generate_elf_file_unittest_relocs.sh for instructions.
+ {
+ 'target_name': 'relocation_packer_test_data',
+ 'toolsets': ['target'],
+ 'type': 'shared_library',
+ 'cflags': [
+ '-O0',
+ '-g0',
+ ],
+ 'sources': [
+ 'test_data/elf_file_unittest_relocs.cc',
+ ],
+ },
+ {
+ 'target_name': 'relocation_packer_unittests_test_data',
+ 'toolsets': ['target'],
+ 'type': 'none',
+ 'actions': [
+ {
+ 'variables': {
+ 'test_file': '<(SHARED_LIB_DIR)/librelocation_packer_test_data.so',
+ 'conditions': [
+ [ 'target_arch == "arm"', {
+ 'added_section': '.android.rel.dyn',
+ 'unpacked_output': 'elf_file_unittest_relocs_arm32.so',
+ 'packed_output': 'elf_file_unittest_relocs_arm32_packed.so',
+ }],
+ [ 'target_arch == "arm64"', {
+ 'added_section': '.android.rela.dyn',
+ 'unpacked_output': 'elf_file_unittest_relocs_arm64.so',
+ 'packed_output': 'elf_file_unittest_relocs_arm64_packed.so',
+ }],
+ ],
+ },
+ 'action_name': 'generate_relocation_packer_test_data',
+ 'inputs': [
+ 'test_data/generate_elf_file_unittest_relocs.py',
+ '<(PRODUCT_DIR)/relocation_packer',
+ '<(test_file)',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(unpacked_output)',
+ '<(INTERMEDIATE_DIR)/<(packed_output)',
+ ],
+ 'action': [
+ 'python', 'test_data/generate_elf_file_unittest_relocs.py',
+ '--android-pack-relocations=<(PRODUCT_DIR)/relocation_packer',
+ '--android-objcopy=<(android_objcopy)',
+ '--added-section=<(added_section)',
+ '--test-file=<(test_file)',
+ '--unpacked-output=<(INTERMEDIATE_DIR)/<(unpacked_output)',
+ '--packed-output=<(INTERMEDIATE_DIR)/<(packed_output)',
],
},
],

Powered by Google App Engine
This is Rietveld 408576698