OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Print a report of symbols stripped by the linker due to being unused. | 6 """Prints a report of symbols stripped by the linker due to being unused. |
7 | 7 |
8 To use, build with these linker flags: | 8 To use, build with these linker flags: |
9 -Wl,--gc-sections | 9 -Wl,--gc-sections |
10 -Wl,--print-gc-sections | 10 -Wl,--print-gc-sections |
11 the first one is the default in Release; search build/common.gypi for it | 11 the first one is the default in Release; search build/common.gypi for it |
12 and to see where to add the other. | 12 and to see where to add the other. |
13 | 13 |
14 Then build, saving the output into a file: | 14 Then build, saving the output into a file: |
15 make chrome 2>&1 | tee buildlog | 15 make chrome 2>&1 | tee buildlog |
16 and run this script on it: | 16 and run this script on it: |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 if len(args) < 1: | 160 if len(args) < 1: |
161 parser.print_help() | 161 parser.print_help() |
162 sys.exit(1) | 162 sys.exit(1) |
163 | 163 |
164 iter = Parse(open(args[0]), | 164 iter = Parse(open(args[0]), |
165 skip_paths=opts.skip_paths, | 165 skip_paths=opts.skip_paths, |
166 only_paths=opts.only_paths) | 166 only_paths=opts.only_paths) |
167 Output(iter) | 167 Output(iter) |
168 | 168 |
| 169 |
169 if __name__ == '__main__': | 170 if __name__ == '__main__': |
170 main() | 171 main() |
OLD | NEW |