kos/scripts/strip.sh
Ari Archer 0b0587eb63
init
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2022-03-21 14:46:50 +02:00

21 lines
607 B
Bash
Executable file

#!/usr/bin/env bash
set -e
main() {
if [ ! "$1" ]; then
echo "Strip binaries"
echo "Usage: $0 [binaries...]"
return 1
fi
for file in "${@:1}"; do
echo "Stripping $file..."
${STRIP:-strip} ${STRIPFLAGS} -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line \
--remove-section=.note.gnu.gold-version --remove-section=.note.gnu.build-id \
--remove-section=.note.ABI-tag --remove-section=.note --remove-section=.gnu.version \
--remove-section=.comment --strip-debug --strip-unneeded "$file"
done
}
main "$@"