mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
stripper: Strip all unneeded relocation information
Libraries were treated differently and therfore it could happen that they were not stripped from any unnecessary relocation information at all. This patch changes that and strips everything from libraries that we do not need. The ISO was 3MB smaller. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
61a4972bc6
commit
25d5058974
12
src/stripper
12
src/stripper
@@ -17,7 +17,7 @@ done
|
||||
|
||||
function _strip() {
|
||||
local file=${1}
|
||||
local cmd="${STRIP-strip}"
|
||||
local strip="${STRIP-strip}"
|
||||
|
||||
local exclude l
|
||||
for exclude in ${excludes}; do
|
||||
@@ -27,17 +27,19 @@ function _strip() {
|
||||
fi
|
||||
done
|
||||
|
||||
local cmd=( "${strip}" )
|
||||
|
||||
case "$(file -bi ${file})" in
|
||||
application/x-sharedlib*|application/x-archive*)
|
||||
cmd="${cmd} --strip-debug --remove-section=.comment --remove-section=.note"
|
||||
application/x-archive*)
|
||||
cmd+=( "--strip-debug" "--remove-section=.comment" "--remove-section=.note" )
|
||||
;;
|
||||
*)
|
||||
cmd="${cmd} --strip-unneeded"
|
||||
cmd+=( "--strip-all" )
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Stripping ${file}..."
|
||||
${cmd} ${file}
|
||||
${cmd[*]} ${file}
|
||||
}
|
||||
|
||||
for dir in ${dirs}; do
|
||||
|
||||
Reference in New Issue
Block a user