summaryrefslogtreecommitdiffstats
path: root/bin/prepstrip
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-21 05:14:51 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-21 05:14:51 +0000
commit0e0450c495ff5f7a44e5f0e81c459fec99cd6c84 (patch)
tree27e0580c240f97baff78cc422233c07a11483ea2 /bin/prepstrip
parent19f6ba3fe24acb38602bbddd957ac51b196f567d (diff)
downloadportage-0e0450c495ff5f7a44e5f0e81c459fec99cd6c84.tar.gz
portage-0e0450c495ff5f7a44e5f0e81c459fec99cd6c84.tar.bz2
portage-0e0450c495ff5f7a44e5f0e81c459fec99cd6c84.zip
strip .comment by default, add a comment as to what we need before we can do .note, and add safe stripping of relocatable objects (trunk r6416)
svn path=/main/branches/2.1.2/; revision=6901
Diffstat (limited to 'bin/prepstrip')
-rwxr-xr-xbin/prepstrip14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/prepstrip b/bin/prepstrip
index 46d051d3f..4e4e78923 100755
--- a/bin/prepstrip
+++ b/bin/prepstrip
@@ -18,7 +18,10 @@ type -P -- ${STRIP} > /dev/null || STRIP=strip
OBJCOPY=${OBJCOPY:-${CHOST}-objcopy}
type -P -- ${OBJCOPY} > /dev/null || OBJCOPY=objcopy
-export PORTAGE_STRIP_FLAGS=${PORTAGE_STRIP_FLAGS:---strip-unneeded}
+# We'll leave out -R .note for now until we can check out the relevance
+# of the section when it has the ALLOC flag set on it ...
+export SAFE_STRIP_FLAGS="--strip-unneeded"
+export PORTAGE_STRIP_FLAGS=${PORTAGE_STRIP_FLAGS-${SAFE_STRIP_FLAGS} -R .comment}
banner=1
@@ -86,11 +89,14 @@ for x in $(scanelf -yqRBF '#k%F' -k '.symtab' "$@") $(for y in "$@"; do find "${
vecho " ${x:${#D}}"
[[ -n ${NOSTRIP} ]] && continue
[[ ${stripitbaby} -eq 1 ]] && ${STRIP} -g "${x}"
- fi
- if [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* ]] ; then
+ elif [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* || ${f} == *"SB relocatable"* ]] ; then
vecho " ${x:${#D}}"
save_elf_debug "${x}"
[[ -n ${NOSTRIP} ]] && continue
- [[ ${stripitbaby} -eq 1 ]] && ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
+ if [[ ${stripitbaby} -eq 1 ]] ; then
+ [[ ${f} == *"SB relocatable"* ]] \
+ && ${STRIP} ${SAFE_STRIP_FLAGS} "${x}" \
+ || ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
+ fi
fi
done