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

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



Hello Ben,

On Tuesday 17 Aug 2010 06:05:35 Ben Hutchings wrote:
> Please add the check for DEBUG, and test that the result works.  I think
> we can live with this for now and move it into Kbuild later.

Patch attached. Please review and commit.
Added the if condition to check for DEBUG. Built the kernels and everything 
looks fine.

Please add it to the Squeeze kernel too. This patch will make systemtap in 
squeeze, fully functional, for the kernel.

Ritesh

-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
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..ca94976 100644
--- a/rules.real
+++ b/rules.real
@@ -345,6 +345,11 @@ 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
+ifeq ($(DEBUG),True)
+	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
+endif
 	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.*}

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


Reply to: