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

Unified 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: Deconditionalize irt_tls.c 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 side-by-side diff with in-line comments
Download patch
Index: src/untrusted/irt/check_tls.py
diff --git a/src/untrusted/irt/check_tls.py b/src/untrusted/irt/check_tls.py
new file mode 100644
index 0000000000000000000000000000000000000000..de7a746e83b260239efc8bdee175b6ca65100d00
--- /dev/null
+++ b/src/untrusted/irt/check_tls.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# A simple program to run objdump on a file and assert that '%gs'
+# appears nowhere in it. This ensures that the direct register access
+# style of TLS is not being used in the IRT blob.
+
+import subprocess
+import sys
+
+
+def Main(args):
+ objdump = args[0]
Mark Seaborn 2011/04/13 20:32:30 Maybe also do "assert len(args) == 2" (or a more i
+ obj_file = args[1]
+ proc = subprocess.Popen([objdump, '-d', obj_file], stdout=subprocess.PIPE)
+ for line in proc.stdout:
+ if '%gs' in line:
+ print 'TLS access found: %s' % line
Mark Seaborn 2011/04/13 20:32:30 Can add some more description to the error? e.g.
+ exit(1)
Mark Seaborn 2011/04/13 20:32:30 I think sys.exit is the more correct function to u
+
+
+if __name__ == '__main__':
+ Main(sys.argv[1:])

Powered by Google App Engine
This is Rietveld 408576698