X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/e8cb32229625f8350cb4b18079db34973e6bb4b8..11e663d8459a87510762609dd7e49bcf445feef2:/scripts/strip-kmod.sh diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh index 57207e3ae..2a75e3982 100755 --- a/scripts/strip-kmod.sh +++ b/scripts/strip-kmod.sh @@ -11,16 +11,22 @@ MODULE="$1" exit 1 } +ARGS= +if [ -n "$KEEP_SYMBOLS" ]; then + ARGS="-X --strip-debug" +else + ARGS="-x -G __this_module --strip-unneeded" +fi + ${CROSS}objcopy \ - --strip-unneeded \ -R .comment \ -R .pdr \ -R .mdebug.abi32 \ -R .note.gnu.build-id \ -R .gnu.attributes \ -R .reginfo \ - -G __this_module \ - -x "$MODULE" "$MODULE.tmp" + $ARGS \ + "$MODULE" "$MODULE.tmp" [ -n "$NO_RENAME" ] && { mv "${MODULE}.tmp" "$MODULE"