projects
/
oweals
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lantiq: re-enable spi-xway for TD-W89X0 now that it is fixed
[oweals/openwrt.git]
/
scripts
/
strip-kmod.sh
diff --git
a/scripts/strip-kmod.sh
b/scripts/strip-kmod.sh
index 57207e3ae6c36e66e9fd11d63ad266263f0ff959..e3f13bee4766d6611bb526a6b867ee0a3d48f805 100755
(executable)
--- a/
scripts/strip-kmod.sh
+++ b/
scripts/strip-kmod.sh
@@
-11,16
+11,25
@@
MODULE="$1"
exit 1
}
exit 1
}
+ARGS=
+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 \
${CROSS}objcopy \
- --strip-unneeded \
-R .comment \
-R .pdr \
-R .mdebug.abi32 \
-R .comment \
-R .pdr \
-R .mdebug.abi32 \
- -R .note.gnu.build-id \
-R .gnu.attributes \
-R .reginfo \
-R .gnu.attributes \
-R .reginfo \
-
-G __this_module
\
-
-x
"$MODULE" "$MODULE.tmp"
+
$ARGS
\
+ "$MODULE" "$MODULE.tmp"
[ -n "$NO_RENAME" ] && {
mv "${MODULE}.tmp" "$MODULE"
[ -n "$NO_RENAME" ] && {
mv "${MODULE}.tmp" "$MODULE"
@@
-32,9
+41,10
@@
BEGIN {
n = 0
}
n = 0
}
-$3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/ {
+$3 && $2 ~ /[brtd]/ && $3 !~ /\$LC/
&& !def[$3]
{
print "--redefine-sym "$3"=_"n;
n = n + 1
print "--redefine-sym "$3"=_"n;
n = n + 1
+ def[$3] = 1
}
' > "$MODULE.tmp1"
}
' > "$MODULE.tmp1"