kernel: keep more symbols in the kernel modules when doing profiling
authorFelix Fietkau <nbd@openwrt.org>
Thu, 1 Mar 2012 15:13:26 +0000 (15:13 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 1 Mar 2012 15:13:26 +0000 (15:13 +0000)
SVN-Revision: 30762

rules.mk
scripts/strip-kmod.sh

index a0ceca8c2e06be748b1f98e9d4030d6aa456c0d0..6684c93c17b79d07e779f4299f631489aa8fd11b 100644 (file)
--- 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" \
index 57207e3ae6c36e66e9fd11d63ad266263f0ff959..789364f97bbced62345dc5af179142522640a711 100755 (executable)
@@ -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"