Hi,
The following patch adds a new option to eu-strip.
2011-05-23 Mark Wielaard <mjw(a)redhat.com>
* strip.c (OPT_RELOC_DEBUG): New option.
(argp_option): Add new --reloc-debug-sections option.
(main): Check new option.
(parse_opt): Likewise.
(handle_elf): Remove any relocations between debug sections
in ET_REL for the debug file when requested.
eu-strip --reloc-debug-sections is mostly for the separate debuginfo
kernel modules. Which are ET_REL files. So they have relocation
sections. These take up a lot of space for the debug sections. Which
isn't really necessary since those sections are not allocated and will
not be relinked. So you can use eu-strip --reloc-debug-sections in
combination with -f to create a separate .debug file that has all
(simple absolute) cross debug section relocations resolved.
Rebuilding kernel-debuginfo-2.6.35.13-91.fc14.x86_64 showed a nice
reduction in size.
Before: Compressed: 238 M Expanded: 1381 M
After : Compressed: 207 M Expanded: 908 M
On the mjw/reloc-debug-sections branch there are also a couple of
testcases, which make sure there is no difference in readelf -w output
with/without --reloc-debug-sections:
2011-05-23 Mark Wielaard <mjw(a)redhat.com>
* Makefile.am (TESTS): Add run-strip-reloc.sh.
(EXTRA_DIST): Add run-strip-reloc.sh, hello_i386.ko.bz2
hello_x86_64.ko.bz2 and hello_ppc64.ko.bz2
* run-strip-reloc.sh: New test.
* hello_i386.ko.bz2: New test file.
* hello_x86_64.ko.bz2: Likewise.
* hello_ppc64.ko.bz2: Likewise.
Also tested against the above rebuild kernel package with systemtap make
installcheck, which showed no difference in failures.
Please let me know about any comments on the patch before I push it.
Thanks,
Mark