mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
stripper: Strip static archives.
This commit is contained in:
10
src/stripper
10
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
|
||||
|
||||
Reference in New Issue
Block a user