[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#555549: 555549: adding .gnu_debuglink section in kernel modules



tags 555549 +patch
thanks

Hello Bastian,

On Tuesday 10 Aug 2010 13:35:58 Bastian Blank wrote:
> > I tried re-building the kernel image with dh_strip -k  but that did not
> > help.  So, how is the linux-image-xxxx-dbg package created ?
> 
> debian/rules.real shows it.

Thanks for pointing this out. Attached patch adds .gnu_debuglink section to 
the kernel modules pointing to the corresponding kernel modules containing the 
DWARF information.

Please review the patch and apply. I've generated it against the debian/ 
kernel trunk from the svn repository. I would like to see this be part of the 
Squeeze release. So please apply this to the Squeeze kernel too.

Ritesh

-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
From 8bde84867069e548cea2b0825a77274f50194bf9 Mon Sep 17 00:00:00 2001
From: Ritesh Raj Sarraf <rrs@debian.org>
Date: Sat, 14 Aug 2010 02:01:13 +0530
Subject: [PATCH] add .gnu_debuglink DWARF information into kernel modules

---
 changelog                   |    8 +++++++-
 rules.real                  |    3 +++
 templates/control.source.in |    2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/changelog b/changelog
index fb158eb..4374f47 100644
--- a/changelog
+++ b/changelog
@@ -1,8 +1,14 @@
 linux-2.6 (2.6.35-1~experimental.2) UNRELEASED; urgency=low
 
+  [ Ritesh Raj Sarraf ]
+  * Add .gnu_debuglink information into kernel modules to point to the
+    correct DWARF enabled kernel module. This is needed by SystemTap to
+    instrument a kernel module. (Closes: #555549)
+
+  [ maximilian attems ]
   * images: Nuke modules.devname on removal.
 
- -- maximilian attems <maks@debian.org>  Tue, 04 Aug 2010 20:21:16 +0200
+ -- Ritesh Raj Sarraf <rrs@debian.org>  Sat, 14 Aug 2010 01:56:28 +0530
 
 linux-2.6 (2.6.35-1~experimental.1) experimental; urgency=low
 
diff --git a/rules.real b/rules.real
index 0d938f3..bf1771e 100644
--- a/rules.real
+++ b/rules.real
@@ -345,6 +345,9 @@ install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain:
 	  DIR='$(DIR)' PACKAGE_DIR='$(PACKAGE_DIR)' INSTALL_DIR='$(INSTALL_DIR)' REAL_VERSION='$(REAL_VERSION)'
 ifeq ($(MODULES),True)
 	+$(MAKE_CLEAN) -C $(DIR) modules_install INSTALL_MOD_PATH='$(CURDIR)'/$(PACKAGE_DIR) INSTALL_MOD_STRIP=1
+	find $(PACKAGE_DIR) -name '*.ko' | sed 's|$(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/kernel/||' | while read module ; do \
+	  objcopy --add-gnu-debuglink=$(DIR)/$$module $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/kernel/$$module; \
+	done
 	cp $(DIR)/.config $(PACKAGE_DIR)/boot/config-$(REAL_VERSION)
 	cp $(DIR)/System.map $(PACKAGE_DIR)/boot/System.map-$(REAL_VERSION)
 	rm $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/{build,source,modules.*}
diff --git a/templates/control.source.in b/templates/control.source.in
index 377d3b4..c3c8df1 100644
--- a/templates/control.source.in
+++ b/templates/control.source.in
@@ -3,7 +3,7 @@ Priority: optional
 Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
 Uploaders: Bastian Blank <waldi@debian.org>, Frederik Schüler <fs@debian.org>, maximilian attems <maks@debian.org>, Ben Hutchings <ben@decadent.org.uk>
 Standards-Version: 3.8.4
-Build-Depends: debhelper (>> 7), cpio, module-init-tools, python, lzma [armel], libelf-dev, binutils-dev, asciidoc, xmlto
+Build-Depends: debhelper (>> 7), cpio, module-init-tools, python, lzma [armel], libelf-dev, binutils, binutils-dev, asciidoc, xmlto
 Build-Depends-Indep: bzip2, python-support
 Vcs-Svn: svn://svn.debian.org/svn/kernel/dists/sid/linux-2.6/
 Vcs-Browser: http://svn.debian.org/wsvn/kernel/dists/sid/linux-2.6/?op=log
-- 
1.7.1

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: