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 """Helper script to close over all transitive dependencies of a given .nexe | 5 """Helper script to close over all transitive dependencies of a given .nexe |
6 executable. | 6 executable. |
7 | 7 |
8 e.g. Given | 8 e.g. Given |
9 A -> B | 9 A -> B |
10 B -> C | 10 B -> C |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if dynamic: | 82 if dynamic: |
83 return _GetNeededDynamic(main_files, objdump, lib_path) | 83 return _GetNeededDynamic(main_files, objdump, lib_path) |
84 else: | 84 else: |
85 return _GetNeededStatic(main_files) | 85 return _GetNeededStatic(main_files) |
86 | 86 |
87 | 87 |
88 def _GetNeededDynamic(main_files, objdump, lib_path): | 88 def _GetNeededDynamic(main_files, objdump, lib_path): |
89 examined = set() | 89 examined = set() |
90 all_files, unexamined = GleanFromObjdump(main_files, None, objdump, lib_path) | 90 all_files, unexamined = GleanFromObjdump(main_files, None, objdump, lib_path) |
91 for arch in all_files.itervalues(): | 91 for arch in all_files.itervalues(): |
92 if unexamined: | 92 if unexamined and arch != 'arm': |
93 unexamined.add((RUNNABLE_LD, arch)) | 93 unexamined.add((RUNNABLE_LD, arch)) |
94 | 94 |
95 while unexamined: | 95 while unexamined: |
96 files_to_examine = {} | 96 files_to_examine = {} |
97 | 97 |
98 # Take all the currently unexamined files and group them | 98 # Take all the currently unexamined files and group them |
99 # by architecture. | 99 # by architecture. |
100 for name, arch in unexamined: | 100 for name, arch in unexamined: |
101 files_to_examine.setdefault(arch, []).append(name) | 101 files_to_examine.setdefault(arch, []).append(name) |
102 | 102 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 raise Error('cannot find library %s' % name) | 224 raise Error('cannot find library %s' % name) |
225 return files | 225 return files |
226 | 226 |
227 | 227 |
228 def _GetNeededStatic(main_files): | 228 def _GetNeededStatic(main_files): |
229 needed = {} | 229 needed = {} |
230 for filename in main_files: | 230 for filename in main_files: |
231 arch = elf.ParseElfHeader(filename)[0] | 231 arch = elf.ParseElfHeader(filename)[0] |
232 needed[filename] = arch | 232 needed[filename] = arch |
233 return needed | 233 return needed |
OLD | NEW |