X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Fstripper;h=15fa308faff70a1f3731ea395e3e01657788a418;hp=199d17f6a0ced2d67695c87a478a596ab2d1d6cc;hb=d9bb5239918653b581c392bd21ed5c82c1547216;hpb=6db78002695b1de848137b0b2813a95e13db79a0 diff --git a/src/stripper b/src/stripper index 199d17f6a..15fa308fa 100755 --- a/src/stripper +++ b/src/stripper @@ -6,7 +6,7 @@ function _strip() { local cmd="${STRIP-strip}" case "$(file -bi ${file})" in - application/x-sharedlib*) + application/x-sharedlib*|application/x-archive*) cmd="${cmd} --strip-debug --remove-section=.comment --remove-section=.note" ;; *) @@ -19,9 +19,17 @@ function _strip() { } for dir in $@; do + # Strip shared objects. find ${dir} -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \ | file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' | while read file; do _strip ${file} done + + # Strip static archives. + find ${dir} -name \*.a -a -exec file {} \; \ + | grep 'current ar archive' | sed -n -e 's/^\(.*\):[ ]*current ar archive/\1/p' | + while read file; do + _strip ${file} + done done