aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-05-06 17:28:56 +0000
committerColin Cross <ccross@android.com>2019-05-06 17:29:49 +0000
commit619cd098b6008d81876f310e2d83ebf141c4061e (patch)
treedb063ba5ae63200c1a5a9f452553a1fb7122fd85 /scripts
parentbd475367c3dcb4478a70409c99b959ebdb117be3 (diff)
downloadbuild_soong-619cd098b6008d81876f310e2d83ebf141c4061e.tar.gz
build_soong-619cd098b6008d81876f310e2d83ebf141c4061e.tar.bz2
build_soong-619cd098b6008d81876f310e2d83ebf141c4061e.zip
Revert "Strip libgcc to only keep fallback symbols"
This reverts commit bd475367c3dcb4478a70409c99b959ebdb117be3. Reason for revert: b/130267141 Bug: 29275768 Bug: 130267141 Merged-In: I5b349fa6138e51663bf3b67109b880b4356da8e8 Change-Id: Ieab56390b27240ef7f2f52a48a673809da7bcf8e
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/strip.sh54
1 files changed, 15 insertions, 39 deletions
diff --git a/scripts/strip.sh b/scripts/strip.sh
index 0f77da8a..d5369071 100755
--- a/scripts/strip.sh
+++ b/scripts/strip.sh
@@ -24,7 +24,6 @@
# -i ${file}: input file (required)
# -o ${file}: output file (required)
# -d ${file}: deps file (required)
-# -k symbols: Symbols to keep (optional)
# --add-gnu-debuglink
# --keep-mini-debug-info
# --keep-symbols
@@ -33,11 +32,11 @@
set -o pipefail
-OPTSTRING=d:i:o:k:-:
+OPTSTRING=d:i:o:-:
usage() {
cat <<EOF
-Usage: strip.sh [options] -k symbols -i in-file -o out-file -d deps-file
+Usage: strip.sh [options] -i in-file -o out-file -d deps-file
Options:
--add-gnu-debuglink Add a gnu-debuglink section to out-file
--keep-mini-debug-info Keep compressed debug info in out-file
@@ -72,20 +71,6 @@ do_strip_keep_symbols() {
fi
}
-do_strip_keep_symbol_list() {
- if [ -z "${use_gnu_strip}" ]; then
- echo "do_strip_keep_symbol_list does not work with llvm-objcopy"
- echo "http://b/131631155"
- usage
- fi
-
- echo "${symbols_to_keep}" | tr ',' '\n' > "${outfile}.symbolList"
- KEEP_SYMBOLS="-w --strip-unneeded-symbol=* --keep-symbols="
- KEEP_SYMBOLS+="${outfile}.symbolList"
-
- "${CROSS_COMPILE}objcopy" "${infile}" "${outfile}.tmp" ${KEEP_SYMBOLS}
-}
-
do_strip_keep_mini_debug_info() {
rm -f "${outfile}.dynsyms" "${outfile}.funcsyms" "${outfile}.keep_symbols" "${outfile}.debug" "${outfile}.mini_debuginfo" "${outfile}.mini_debuginfo.xz"
local fail=
@@ -139,21 +124,19 @@ do_remove_build_id() {
while getopts $OPTSTRING opt; do
case "$opt" in
- d) depsfile="${OPTARG}" ;;
- i) infile="${OPTARG}" ;;
- o) outfile="${OPTARG}" ;;
- k) symbols_to_keep="${OPTARG}" ;;
- -)
- case "${OPTARG}" in
- add-gnu-debuglink) add_gnu_debuglink=true ;;
- keep-mini-debug-info) keep_mini_debug_info=true ;;
- keep-symbols) keep_symbols=true ;;
- remove-build-id) remove_build_id=true ;;
- use-gnu-strip) use_gnu_strip=true ;;
- *) echo "Unknown option --${OPTARG}"; usage ;;
- esac;;
- ?) usage ;;
- *) echo "'${opt}' '${OPTARG}'"
+ d) depsfile="${OPTARG}" ;;
+ i) infile="${OPTARG}" ;;
+ o) outfile="${OPTARG}" ;;
+ -)
+ case "${OPTARG}" in
+ add-gnu-debuglink) add_gnu_debuglink=true ;;
+ keep-mini-debug-info) keep_mini_debug_info=true ;;
+ keep-symbols) keep_symbols=true ;;
+ remove-build-id) remove_build_id=true ;;
+ *) echo "Unknown option --${OPTARG}"; usage ;;
+ esac;;
+ ?) usage ;;
+ *) echo "'${opt}' '${OPTARG}'"
esac
done
@@ -177,11 +160,6 @@ if [ ! -z "${keep_symbols}" -a ! -z "${keep_mini_debug_info}" ]; then
usage
fi
-if [ ! -z "${symbols_to_keep}" -a ! -z "${keep_symbols}" ]; then
- echo "--keep-symbols and -k cannot be used together"
- usage
-fi
-
if [ ! -z "${add_gnu_debuglink}" -a ! -z "${keep_mini_debug_info}" ]; then
echo "--add-gnu-debuglink cannot be used with --keep-mini-debug-info"
usage
@@ -191,8 +169,6 @@ rm -f "${outfile}.tmp"
if [ ! -z "${keep_symbols}" ]; then
do_strip_keep_symbols
-elif [ ! -z "${symbols_to_keep}" ]; then
- do_strip_keep_symbol_list
elif [ ! -z "${keep_mini_debug_info}" ]; then
do_strip_keep_mini_debug_info
else