From 8440ab72dbbfd99c46a981fa920c5b9c90938028 Mon Sep 17 00:00:00 2001 From: Peter Petrakis Date: Thu, 14 Jun 2012 21:17:38 +0100 Subject: [PATCH] UBUNTU: PACKAGING [v2]: add .gnu_debuglink sections to .ko files BugLink: http://launchpad.net/bugs/669641 Kernel module .ko files now have .gnu_debuglink sections pointing to the full unstripped .ko in /usr/lib/debug/.. in the dbgsym ddebs. Check that debug symbol ko exists before attempting to create .gnu_debuglink section. --- debian/rules.d/2-binary-arch.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 2c7660a..75caf91 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -165,6 +165,15 @@ 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 \ + if [[ -f "$(dbgpkgdir)/usr/lib/debug/$$module" ]] ; then \ + $(CROSS_COMPILE)objcopy \ + --add-gnu-debuglink=$(dbgpkgdir)/usr/lib/debug/$$module \ + $(pkgdir)/$$module; \ + fi; \ + 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.* -- 1.7.9.5