X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=scripts%2Fstrip-kmod.sh;h=313015b909af6957d8b24f36b489c5b1c7e11974;hb=HEAD;hp=789364f97bbced62345dc5af179142522640a711;hpb=d8d82fb79d5fb242b3685318ba5fdf29da8111b5;p=openwrt-github%2F.git diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh index 789364f97b..313015b909 100755 --- a/scripts/strip-kmod.sh +++ b/scripts/strip-kmod.sh @@ -12,15 +12,24 @@ MODULE="$1" } ARGS= -[ -n "$KEEP_SYMBOLS" ] || ARGS="-x -G __this_module --strip-unneeded" +if [ -n "$KEEP_SYMBOLS" ]; then + ARGS="-X --strip-debug" +else + ARGS="-x -G __this_module --strip-unneeded" +fi + +if [ -z "$KEEP_BUILD_ID" ]; then + ARGS="$ARGS -R .note.gnu.build-id" +fi ${CROSS}objcopy \ -R .comment \ -R .pdr \ -R .mdebug.abi32 \ - -R .note.gnu.build-id \ -R .gnu.attributes \ -R .reginfo \ + -R .MIPS.abiflags \ + -R .note.GNU-stack \ $ARGS \ "$MODULE" "$MODULE.tmp" @@ -34,9 +43,10 @@ BEGIN { n = 0 } -$3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/ { +$3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/ && !def[$3] { print "--redefine-sym "$3"=_"n; n = n + 1 + def[$3] = 1 } ' > "$MODULE.tmp1"