OLD | NEW |
---|---|
(Empty) | |
1 # Copyright (c) 2011 The Native Client 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 # A simple program to run objdump on a file and assert that '%gs' | |
6 # appears nowhere in it. This ensures that the direct register access | |
7 # style of TLS is not being used in the IRT blob. | |
8 | |
9 import subprocess | |
10 import sys | |
11 | |
12 | |
13 def Main(args): | |
14 objdump = args[0] | |
Mark Seaborn
2011/04/13 20:32:30
Maybe also do "assert len(args) == 2" (or a more i
| |
15 obj_file = args[1] | |
16 proc = subprocess.Popen([objdump, '-d', obj_file], stdout=subprocess.PIPE) | |
17 for line in proc.stdout: | |
18 if '%gs' in line: | |
19 print 'TLS access found: %s' % line | |
Mark Seaborn
2011/04/13 20:32:30
Can add some more description to the error?
e.g.
| |
20 exit(1) | |
Mark Seaborn
2011/04/13 20:32:30
I think sys.exit is the more correct function to u
| |
21 | |
22 | |
23 if __name__ == '__main__': | |
24 Main(sys.argv[1:]) | |
OLD | NEW |