From 65513890829eff5ccbc48f25c26667a90cfc9718 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 7 Jul 2007 09:38:13 +0000 Subject: `find` can accept a list of paths so condense this nested for loop, and dont split off debug information for ET_REL files as these are never pulled in via debug utilities (and can trigger weird behavior in binutils when linked into things, like glibcs crt1.o) svn path=/main/trunk/; revision=7189 --- bin/prepstrip | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/prepstrip b/bin/prepstrip index 4e4e78923..539eba2f1 100755 --- a/bin/prepstrip +++ b/bin/prepstrip @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -51,7 +51,6 @@ save_elf_debug() { ${OBJCOPY} --only-keep-debug "${x}" "${y}" ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}" chmod a-x,o-w "${y}" - } # The existance of the section .symtab tells us that a binary is stripped. @@ -66,7 +65,10 @@ if [[ -n "${f}" ]] ; then fi # Now we look for unstripped binaries. -for x in $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") $(for y in "$@"; do find "${y}" -type f -name '*.a' -print ; done); do +for x in \ + $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") \ + $(find "$@" -type f -name '*.a') +do if [[ ${banner} -eq 1 ]] ; then [[ -z ${NOSTRIP} ]] && vecho "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}" banner=0 @@ -91,7 +93,7 @@ for x in $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") $(for y in "$@"; do find "${ [[ ${stripitbaby} -eq 1 ]] && ${STRIP} -g "${x}" elif [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* || ${f} == *"SB relocatable"* ]] ; then vecho " ${x:${#D}}" - save_elf_debug "${x}" + [[ ${f} != *"SB relocatable"* ]] && save_elf_debug "${x}" [[ -n ${NOSTRIP} ]] && continue if [[ ${stripitbaby} -eq 1 ]] ; then [[ ${f} == *"SB relocatable"* ]] \ -- cgit v1.2.3-1-g7c22