aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-10-30 15:20:12 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-10-30 15:20:12 +0000
commitf666ce40f8d717986f9695f03a175cff8534e2ff (patch)
tree7b4055c9a89391984fdcf0b731d9ae53763499d1 /scripts
parentaaeea311e6a8caed14511dc6489665ee9ad681d0 (diff)
downloadmaster-187ad058-f666ce40f8d717986f9695f03a175cff8534e2ff.tar.gz
master-187ad058-f666ce40f8d717986f9695f03a175cff8534e2ff.tar.bz2
master-187ad058-f666ce40f8d717986f9695f03a175cff8534e2ff.zip
build: Allow kernel modules to set build ID debug symbol
This change adds support for specifying a build ID for kernel modules. This is done by setting PKG_BUILD_ID to a hexadecimal string, which will then be passed to the kernel linker. In addition, when this flag is set, the build ID debug symbol (.note.gnu.build-id) will not be stripped from the kernel module. This symbol is exported in sysfs by the kernel (if the kernel is compiled with CONFIG_KALLSYMS) and so can be used to uniquely identify a version of a kernel module in a running kernel. This is useful for keeping track of different versions of a module when doing experiments and development. Modules that specify the build ID will be ~100 bytes larger (depending on the length of the build ID specified). There is no size difference for kernel modules that do not set this variable. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47290 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/strip-kmod.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/strip-kmod.sh b/scripts/strip-kmod.sh
index 13e6b58007..e3f13bee47 100755
--- a/scripts/strip-kmod.sh
+++ b/scripts/strip-kmod.sh
@@ -18,11 +18,14 @@ 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 \
$ARGS \