diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-07-31 15:50:41 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:35:23 +0000 |
commit | 7b2ffa587235a47d4094787d72f38102089f402a (patch) | |
tree | 30e82af9cbab08a7fa028bb18f4f2987a3f74dfa /chromium/build/extract_partition.py | |
parent | d94af01c90575348c4e81a418257f254b6f8d225 (diff) | |
download | qtwebengine-chromium-7b2ffa587235a47d4094787d72f38102089f402a.tar.gz |
BASELINE: Update Chromium to 76.0.3809.94
Change-Id: I321c3f5f929c105aec0f98c5091ef6108822e647
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/build/extract_partition.py')
-rwxr-xr-x | chromium/build/extract_partition.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/chromium/build/extract_partition.py b/chromium/build/extract_partition.py new file mode 100755 index 00000000000..52607c85b76 --- /dev/null +++ b/chromium/build/extract_partition.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# Copyright 2019 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. +"""Extracts an LLD partition from an ELF file.""" + +import argparse +import subprocess +import sys + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + '--partition', + help='Name of partition if not the main partition', + metavar='PART') + parser.add_argument( + '--objcopy', + required=True, + help='Path to llvm-objcopy binary', + metavar='FILE') + parser.add_argument( + '--unstripped-output', + required=True, + help='Unstripped output file', + metavar='FILE') + parser.add_argument( + '--stripped-output', + required=True, + help='Stripped output file', + metavar='FILE') + parser.add_argument('input', help='Input file') + args = parser.parse_args() + + objcopy_args = [args.objcopy] + if args.partition: + objcopy_args += ['--extract-partition', args.partition] + else: + objcopy_args += ['--extract-main-partition'] + objcopy_args += [args.input, args.unstripped_output] + subprocess.check_call(objcopy_args) + + objcopy_args = [ + args.objcopy, '--strip-all', args.unstripped_output, args.stripped_output + ] + subprocess.check_call(objcopy_args) + + +if __name__ == '__main__': + sys.exit(main()) |