aboutsummaryrefslogtreecommitdiff
path: root/debian/rules.d/2-binary-arch.mk
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules.d/2-binary-arch.mk')
-rw-r--r--debian/rules.d/2-binary-arch.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 22e9e513f7e..4d4378b3cc1 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -163,6 +163,13 @@ ifneq ($(skipdbg),true)
$(dbgpkgdir)/usr/lib/debug/boot/vmlinux-$(abi_release)-$*
$(build_cd) $(kmake) $(build_O) modules_install \
INSTALL_MOD_PATH=$(dbgpkgdir)/usr/lib/debug
+ # Add .gnu_debuglink sections to each stripped .ko
+ # pointing to unstripped verson
+ find $(pkgdir) -name '*.ko' | sed 's|$(pkgdir)||' | while read module ; do \
+ $(CROSS_COMPILE)objcopy \
+ --add-gnu-debuglink=$(dbgpkgdir)/usr/lib/debug/$$module \
+ $(pkgdir)/$$module; \
+ done
rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/build
rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/source
rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/modules.*