summaryrefslogtreecommitdiffstats
path: root/build/linux
diff options
context:
space:
mode:
authormmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 19:21:20 +0000
committermmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 19:21:20 +0000
commitc2512482d0708c7a00307650194634e51b9beb60 (patch)
tree340d98a5b080170ebe7da4a76301fdae3004a91a /build/linux
parentadca6ba1a59eadfb8e8d49b7411cc78f980cf04a (diff)
downloadchromium_src-c2512482d0708c7a00307650194634e51b9beb60.zip
chromium_src-c2512482d0708c7a00307650194634e51b9beb60.tar.gz
chromium_src-c2512482d0708c7a00307650194634e51b9beb60.tar.bz2
Cleanups from post-submit suggestions.
Review URL: http://codereview.chromium.org/126062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/linux')
-rwxr-xr-xbuild/linux/dump_app_syms12
-rwxr-xr-xbuild/linux/dump_signature.py9
2 files changed, 10 insertions, 11 deletions
diff --git a/build/linux/dump_app_syms b/build/linux/dump_app_syms
index 85544be..1ebac58 100755
--- a/build/linux/dump_app_syms
+++ b/build/linux/dump_app_syms
@@ -10,7 +10,7 @@
set -e
usage() {
- echo "$0 <dump_syms_exe> <binary_with_symbols> <symbols_output>"
+ echo "$0 <dump_syms_exe> <binary_with_symbols> <symbols_output>" >&2
}
@@ -26,12 +26,14 @@ OUTFILE="$3"
STRIPPED=$(mktemp -q -t stripped-XXXXX)
if [ $? -ne 0 ]; then
- echo "ERROR: Could not create temp stripped '$INFILE'"
+ echo "ERROR: Could not create temp stripped '$INFILE'" >&2
exit 1
fi
# Dump the symbols from the given binary.
-"$DUMPSYMS" "$INFILE" > "$OUTFILE"
+if [ "$INFILE" -nt "$OUTFILE" ]; then
+ "$DUMPSYMS" "$INFILE" > "$OUTFILE"
+fi
# Strip the binary and calculate the signature of that, since that's what ships.
strip "$INFILE" -o "$STRIPPED"
@@ -39,6 +41,4 @@ 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"
-
+sed -i "1s/ [0-9A-F]* / $NEWSIG /" "$OUTFILE"
diff --git a/build/linux/dump_signature.py b/build/linux/dump_signature.py
index 779bf85..10bb2e0 100755
--- a/build/linux/dump_signature.py
+++ b/build/linux/dump_signature.py
@@ -8,6 +8,7 @@
# src/breakpad/linux/minidump_writer.cc@17081
import sys
+import struct
if len(sys.argv) != 2:
sys.stderr.write("Error, no filename specified.\n")
@@ -17,15 +18,13 @@ bin = open(sys.argv[1])
data = bin.read(4096)
if len(data) != 4096:
sys.stderr.write("Error, did not read first page of data.\n");
+ sys.exit(1)
bin.close()
signature = [0] * 16
for i in range(0, 4096):
signature[i % 16] ^= ord(data[i])
-out = ''
-# Assume we're running on little endian
-for i in [3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15]:
- out += '%02X' % signature[i]
-out += '0'
+out = ('%08x%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x0' %
+ struct.unpack('I2H8B', struct.pack('16B', *signature)))
sys.stdout.write(out)