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

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



On Sat, Aug 14, 2010 at 04:17:27AM +0100, Ben Hutchings wrote:
> [I also wonder why we are copying the unstripped modules into
> /usr/lib/debug and not just debug info?

Because the tools can't cope with them.

>                                          And shouldn't this really be
> part of Kbuild?  Here's how we could do it in Kbuild:

>  quiet_cmd_modules_install = INSTALL $@
> +ifdef INSTALL_MOD_DEBUGLINK
> +      cmd_modules_install = mkdir -p $(2); mkdir -p $(3); $(OBJCOPY) --only-keep-debug $@ $(3)/$(@F) && $(OBJCOPY) --strip-debug --add-gnu-debuglink=$(3)/$(@F) $@ $(2)/$(@F)

The link looks wrong, it includes the absolute path during install time.

+      cmd_modules_install = mkdir -p $(2); mkdir -p $(3); $(OBJCOPY) --only-keep-debug $@ $(3)/$(@F) && $(OBJCOPY) --strip-debug --add-gnu-debuglink=$(4)/$(@F) $@ $(2)/$(@F)

>  $(modules):
> -	$(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
> +	$(call cmd,modules_install,$(MODLIB)/$(modinst_dir),$(MODLIB_DEBUG)/$(modinst_dir))
+	$(call cmd,modules_install,$(MODLIB)/$(modinst_dir),$(MODLIB_DEBUG)/$(modinst_dir),$(MODLIB_DIR)/$(modinst_dir))

> I'm less sure how we would invoke this in debian/rules.*.  I think we
> would need to build the image and image-dbg packages at the same time.]

Yes, something like:

make modules_install INSTALL_MOD_PATH=debian/build/install_bla INSTALL_MOD_DEBUGLINK=1
dh_install -p $image --srcdir debian/build/install_bla /boot /lib/modules
if DEBUG
dh_install -p $debug --srcdir debian/build/install_bla /usr/lib/debug
endif

Bastian

-- 
We Klingons believe as you do -- the sick should die.  Only the strong
should live.
		-- Kras, "Friday's Child", stardate 3497.2



Reply to: