[Rpm-maint] [PATCH] Support eu-strip --reloc-debug-sections with find-debuginfo -r

Mark Wielaard mjw at redhat.com
Thu May 26 14:56:04 UTC 2011

On Thu, 2011-05-26 at 16:39 +0200, devzero2000 wrote:
> On Wed, May 25, 2011 at 11:36 PM, Mark Wielaard <mjw at redhat.com> wrote:
> > The attached patch adds an -r argument flag to find-debuginfo. When that
> > flag is given then find-debuginfo will invoke eu-strip with
> > --reloc-debug-sections. This is a new option to eu-strip that strips
> > out/resolves relocations between .debug_* elf sections in ET_REL files.
> > This can save a lot of space for kernel module. For example rebuilding
> > kernel-debuginfo- showed a nice reduction in
> > size when using find-debuginfo -r with a new eu-strip from elfutils was
> > installed.
> > Before: Compressed: 238 M Expanded: 1381 M
> > After : Compressed: 207 M Expanded: 908 M
> >
> I was noticed, at least on Fedora, that this option leads to a reduction of
> the size of many shared lib or binary of 40% . There would be
> drawbacks to enable it in every package if it is supported by elfutils ?

The option does nothing for shared library (ET_DYN) or executable
(ET_EXEC) files. It is specific to ET_REL files. Which normally are (.o)
objects files created by the compiler that can be relinked by the linker
with other object files (to create shared libraries or executables). It
just happens that kernel modules (.ko files) are also ET_REL files, and
those .ko files also still contain all the relocations for the .debug_*
elf sections. Since they will never be relinked with other object files
(especially after stripping the debug sections away), it just makes
sense to just apply all relocations to the debug sections to saves

So it only makes sense to enable this option in the SPEC file for the
kernel modules. It should be harmless when enabled for other packages.



More information about the Rpm-maint mailing list