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

devzero2000 pinto.elia at gmail.com
Thu May 26 15:37:26 UTC 2011


On Thu, May 26, 2011 at 4:56 PM, Mark Wielaard <mjw at redhat.com> wrote:

> 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-2.6.35.13-91.fc14.x86_64 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
> space.
>
> 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.
>
I had thought the same thing, but initially i have done some experiment
and with some big shared lib I had a great reduction, strangely
enough. Buti have given  now a better look and
control is not always so, and with some executable i have also some
expansion :=). I will follow your raccomandation. Thanks for the
clarification.

Best Regards


> Cheers,
>
> Mark
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20110526/7a384219/attachment.html>


More information about the Rpm-maint mailing list