X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=scripts%2Fstrip-kmod.sh;h=313015b909af6957d8b24f36b489c5b1c7e11974;hp=2a75e39821121b7992f3ba66687077fa7a649a74;hb=98206cb9c62a86f3e72b74a71e9ed836bac1fc71;hpb=7b609a31bede49a725e79324b49a16b0d31a9323 diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh index 2a75e39821..313015b909 100755 --- a/scripts/strip-kmod.sh +++ b/scripts/strip-kmod.sh @@ -18,13 +18,18 @@ 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" @@ -38,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"