blob: 632bcc76a9546293de7ecbd7e8a4f18d8738da5f [file] [log] [blame]
[email protected]a6a53d02009-06-12 17:19:161#!/bin/sh
2
[email protected]66e6560a2010-04-06 16:54:403# Copyright (c) 2010 The Chromium Authors. All rights reserved.
[email protected]a6a53d02009-06-12 17:19:164# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6#
[email protected]66e6560a2010-04-06 16:54:407# Helper script to run dump_syms on Chrome Linux executables and strip
8# them if needed.
[email protected]a6a53d02009-06-12 17:19:169
10set -e
11
12usage() {
[email protected]05cb6962009-10-01 23:29:0313 echo -n "$0 <dump_syms_exe> <strip_binary> " >&2
14 echo "<binary_with_symbols> <symbols_output>" >&2
[email protected]a6a53d02009-06-12 17:19:1615}
16
17
[email protected]05cb6962009-10-01 23:29:0318if [ $# -ne 4 ]; then
[email protected]a6a53d02009-06-12 17:19:1619 usage
20 exit 1
21fi
22
23SCRIPTDIR="$(readlink -f "$(dirname "$0")")"
24DUMPSYMS="$1"
[email protected]66e6560a2010-04-06 16:54:4025STRIP_BINARY="$2"
[email protected]05cb6962009-10-01 23:29:0326INFILE="$3"
27OUTFILE="$4"
[email protected]a6a53d02009-06-12 17:19:1628
[email protected]a6a53d02009-06-12 17:19:1629# Dump the symbols from the given binary.
[email protected]437bf9472009-06-17 21:50:2330if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then
[email protected]c2512482009-06-12 19:21:2031 "$DUMPSYMS" "$INFILE" > "$OUTFILE"
32fi
[email protected]a6a53d02009-06-12 17:19:1633
[email protected]66e6560a2010-04-06 16:54:4034if [ "$STRIP_BINARY" != "0" ]; then
35 strip "$INFILE"
[email protected]05cb6962009-10-01 23:29:0336fi