Merge "Hide warning on static executables in strip.sh"
diff --git a/scripts/strip.sh b/scripts/strip.sh
index cf8f631..bfc66ee 100755
--- a/scripts/strip.sh
+++ b/scripts/strip.sh
@@ -29,6 +29,8 @@
 #   --keep-symbols
 #   --use-llvm-strip
 
+set -o pipefail
+
 OPTSTRING=d:i:o:-:
 
 usage() {
@@ -83,7 +85,7 @@
         # For the following use cases, ${CROSS_COMPILE}objcopy does fine with lld linked files,
         # except the --add-section flag.
         "${CROSS_COMPILE}objcopy" --only-keep-debug "${infile}" "${outfile}.debug"
-        "${CROSS_COMPILE}nm" -D "${infile}" --format=posix --defined-only | awk '{ print $1 }' | sort >"${outfile}.dynsyms"
+        "${CROSS_COMPILE}nm" -D "${infile}" --format=posix --defined-only 2> /dev/null | awk '{ print $1 }' | sort >"${outfile}.dynsyms"
         "${CROSS_COMPILE}nm" "${infile}" --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t" || $2 == "D") print $1 }' | sort > "${outfile}.funcsyms"
         comm -13 "${outfile}.dynsyms" "${outfile}.funcsyms" > "${outfile}.keep_symbols"
         echo >> "${outfile}.keep_symbols" # Ensure that the keep_symbols file is not empty.