michael@0: #!/bin/sh michael@0: michael@0: # Copyright (c) 2010 The Chromium Authors. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: # michael@0: # Helper script to run dump_syms on Chrome Linux executables and strip michael@0: # them if needed. michael@0: michael@0: set -e michael@0: michael@0: usage() { michael@0: echo -n "$0 " >&2 michael@0: echo " " >&2 michael@0: } michael@0: michael@0: michael@0: if [ $# -ne 4 ]; then michael@0: usage michael@0: exit 1 michael@0: fi michael@0: michael@0: SCRIPTDIR="$(readlink -f "$(dirname "$0")")" michael@0: DUMPSYMS="$1" michael@0: STRIP_BINARY="$2" michael@0: INFILE="$3" michael@0: OUTFILE="$4" michael@0: michael@0: # Dump the symbols from the given binary. michael@0: if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then michael@0: "$DUMPSYMS" "$INFILE" > "$OUTFILE" michael@0: fi michael@0: michael@0: if [ "$STRIP_BINARY" != "0" ]; then michael@0: strip "$INFILE" michael@0: fi