Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: src/untrusted/irt/check_tls.py

Issue 6839002: Pass -mtls-use-call when building libraries used in IRT. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: more comments; typo fix; conditionalize irt_tls.c vs bitcode Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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]
15 obj_file = args[1]
16 assert(len(args) == 2)
17 proc = subprocess.Popen([objdump, '-d', obj_file], stdout=subprocess.PIPE)
18 for line in proc.stdout:
19 if '%gs' in line:
20 print '%gs use found: %s' % line
21 print 'This looks like an x86-32 direct TLS use.'
22 print 'Such uses are disallowed by the IRT execution context constraints.'
23 print 'These never happen if -mtls-use-call is used in the compilation.'
24 print 'Check that all libraries used in the IRT were compiled that way.'
25 sys.exit(1)
26
27
28 if __name__ == '__main__':
29 Main(sys.argv[1:])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698