aboutsummaryrefslogtreecommitdiffstats
path: root/rules.mk
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
commit3bbb92772813c7a955d210f0e82ebdedd3183cec (patch)
treecd2af101317782b50e042653366438ecddcea63d /rules.mk
parent1cfa2a674757f6ee776436154d2b8d34fb2b1114 (diff)
downloadupstream-3bbb92772813c7a955d210f0e82ebdedd3183cec.tar.gz
upstream-3bbb92772813c7a955d210f0e82ebdedd3183cec.tar.bz2
upstream-3bbb92772813c7a955d210f0e82ebdedd3183cec.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> SVN-Revision: 47290
Diffstat (limited to 'rules.mk')
-rw-r--r--rules.mk3
1 files changed, 2 insertions, 1 deletions
diff --git a/rules.mk b/rules.mk
index 819bea5f5a..7710fb4d9d 100644
--- a/rules.mk
+++ b/rules.mk
@@ -273,8 +273,9 @@ else
STRIP:=$(STAGING_DIR_HOST)/bin/sstrip
endif
endif
- RSTRIP:= \
+ RSTRIP= \
export CROSS="$(TARGET_CROSS)" \
+ $(if $(PKG_BUILD_ID),KEEP_BUILD_ID=1) \
$(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \
$(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \
NM="$(TARGET_CROSS)nm" \