Index: build/linux/dump_app_syms |
diff --git a/build/linux/dump_app_syms b/build/linux/dump_app_syms |
new file mode 100755 |
index 0000000000000000000000000000000000000000..85544be2cbeed467aa539b83bfcadd4940b0d2c2 |
--- /dev/null |
+++ b/build/linux/dump_app_syms |
@@ -0,0 +1,44 @@ |
+#!/bin/sh |
Mark Mentovai
2009/06/12 17:30:10
svn:executable and svn:eol-style?
|
+ |
+# Copyright (c) 2009 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. |
+# |
+# Helper script to run dump_syms on Chrome Linux executables and "fixup" the |
+# generated sigs (due to changes to the binary from stripping). |
+ |
+set -e |
+ |
+usage() { |
+ echo "$0 <dump_syms_exe> <binary_with_symbols> <symbols_output>" |
+} |
+ |
+ |
+if [ $# -ne 3 ]; then |
+ usage |
+ exit 1 |
+fi |
+ |
+SCRIPTDIR="$(readlink -f "$(dirname "$0")")" |
+DUMPSYMS="$1" |
+INFILE="$2" |
+OUTFILE="$3" |
+ |
+STRIPPED=$(mktemp -q -t stripped-XXXXX) |
+if [ $? -ne 0 ]; then |
+ echo "ERROR: Could not create temp stripped '$INFILE'" |
Mark Mentovai
2009/06/12 17:30:10
echo blah >& 2 (also for usage()?)
|
+ exit 1 |
+fi |
+ |
+# Dump the symbols from the given binary. |
+"$DUMPSYMS" "$INFILE" > "$OUTFILE" |
Mark Mentovai
2009/06/12 17:30:10
In the Mac version of this script, we have an -nt
|
+ |
+# Strip the binary and calculate the signature of that, since that's what ships. |
+strip "$INFILE" -o "$STRIPPED" |
+NEWSIG=$("$SCRIPTDIR/dump_signature.py" "$STRIPPED") |
+rm "$STRIPPED" |
+ |
+# Replace the old signature with the stripped signature in the symbols file. |
+INFILE_BASE=$(basename "$INFILE") |
+sed -i "1s/[0-9A-F]* $INFILE_BASE/$NEWSIG $INFILE_BASE/" "$OUTFILE" |
Mark Mentovai
2009/06/12 17:30:10
This is slightly dangerous in the general case bec
|
+ |
Mark Mentovai
2009/06/12 17:30:10
nit: blank line at EOF doesn't contribute anything
|