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

Unified Diff: chrome/nacl/nacl_helper_bootstrap_munge_phdr.py

Issue 7795010: Use chain-loading for Linux nacl_helper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review nits Created 9 years, 4 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
« no previous file with comments | « chrome/nacl/nacl_helper_bootstrap_munge_phdr.c ('k') | chrome/nacl/nacl_helper_exports.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/nacl/nacl_helper_bootstrap_munge_phdr.py
diff --git a/chrome/nacl/nacl_helper_bootstrap_munge_phdr.py b/chrome/nacl/nacl_helper_bootstrap_munge_phdr.py
new file mode 100755
index 0000000000000000000000000000000000000000..c3a3931b2485c31670cecd2ed6a021b39a4b3641
--- /dev/null
+++ b/chrome/nacl/nacl_helper_bootstrap_munge_phdr.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# This takes three command-line arguments:
+# MUNGE-PHDR-PROGRAM file name of program built from
+# nacl_helper_bootstrap_munge_phdr.c
+# INFILE raw linked ELF file name
+# OUTFILE output file name
+#
+# We just run the MUNGE-PHDR-PROGRAM on a copy of INFILE.
+# That modifies the file in place. Then we move it to OUTFILE.
+#
+# We only have this wrapper script because nacl_helper_bootstrap_munge_phdr.c
+# wants to modify a file in place (and it would be a much longer and more
+# fragile program if it created a fresh ELF output file instead).
+
+import shutil
+import subprocess
+import sys
+
+
+def Main(argv):
+ if len(argv) != 4:
+ print 'Usage: %s MUNGE-PHDR-PROGRAM INFILE OUTFILE' % argv[0]
+ sys.exit(1)
+ [prog, munger, infile, outfile] = argv
+ tmpfile = outfile + '.tmp'
+ shutil.copy(infile, tmpfile)
+ segment_num = '1'
+ subprocess.check_call([munger, tmpfile, segment_num])
+ shutil.move(tmpfile, outfile)
+
+if __name__ == '__main__':
+ Main(sys.argv)
« no previous file with comments | « chrome/nacl/nacl_helper_bootstrap_munge_phdr.c ('k') | chrome/nacl/nacl_helper_exports.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698