summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-03-01 15:13:26 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-03-01 15:13:26 +0000
commitba66a4b9614b5c4e84cc266beb5fdfed0d1783a5 (patch)
tree66930e31cf682fe578a74f9e53af5e60f969068c
parent08faa98372f084b2eef9c0bb982da6c7147a5cd6 (diff)
kernel: keep more symbols in the kernel modules when doing profiling
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30762 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--rules.mk4
-rwxr-xr-xscripts/strip-kmod.sh8
2 files changed, 8 insertions, 4 deletions
diff --git a/rules.mk b/rules.mk
index a0ceca8c2..6684c93c1 100644
--- a/rules.mk
+++ b/rules.mk
@@ -220,7 +220,9 @@ else
endif
endif
RSTRIP:= \
- export CROSS="$(TARGET_CROSS)" $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1); \
+ export CROSS="$(TARGET_CROSS)" \
+ $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \
+ $(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \
NM="$(TARGET_CROSS)nm" \
STRIP="$(STRIP)" \
STRIP_KMOD="$(SCRIPT_DIR)/strip-kmod.sh" \
diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh
index 57207e3ae..789364f97 100755
--- a/scripts/strip-kmod.sh
+++ b/scripts/strip-kmod.sh
@@ -11,16 +11,18 @@ MODULE="$1"
exit 1
}
+ARGS=
+[ -n "$KEEP_SYMBOLS" ] || ARGS="-x -G __this_module --strip-unneeded"
+
${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"