public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* Add eu-strip --reloc-debug-sections-only option
@ 2018-10-26 21:51 Mark Wielaard
  2018-10-26 21:51 ` [PATCH 3/4] strip: Extract code to update shdrstrndx into new common function Mark Wielaard
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Mark Wielaard @ 2018-10-26 21:51 UTC (permalink / raw)
  To: elfutils-devel

Hi,

eu-strip already supports --reloc-debug-sections to resolve all
relocations between .debug_ sections while creating a separate
.debug file with -f. It is sometimes useful to do the same without
doing any other stripping.

  --reloc-debug-sections-only
                         Similar to --reloc-debug-sections, but resolve all
                         trivial relocations between debug sections in
                         place.  No other stripping is performed (operation
                         is not reversable, incompatible with -f, -g,
                         --remove-comment and --remove-section)

For example to ease debugging, tracing and profiling some distributions
ship an uncompressed vmlinux ELF file which includes DWARF debuginfo.
Since the vmlinux ELF kernel is relocatable, the relocations between the
.debug sections are also still left in. On Fedora this file is 662M.
eu-strip --reloc-debug-sections-only will remove more than 250MB of
(unneeded) relocations between the .debug sections.

To reuse as much code as possible this patch series first refactors
some of the code. It also makes it so that the type of ELF file doesn't
matter for doing relocations (normally it only makes sense for ET_REL
files, but the vmlinux ELF image is an ET_EXEC with SHT_RELA sections).

It also adds a new testcase to run-strip-reloc.sh to make sure that the
result of creating a separate debug file using --reloc-debug-sections
is identical to creating a separate debug file and then running eu-strip
with --reloc-debug-sections-only.

[PATCH 1/4] strip: Always copy over any phdrs if there are any
[PATCH 2/4] strip: Split out debug section relocation into separate helper
[PATCH 3/4] strip: Extract code to update shdrstrndx into new common function
[PATCH 4/4] strip: Add --reloc-debug-sections-only option

 Cheers,

 Mark

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-11-09 16:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 21:51 Add eu-strip --reloc-debug-sections-only option Mark Wielaard
2018-10-26 21:51 ` [PATCH 3/4] strip: Extract code to update shdrstrndx into new common function Mark Wielaard
2018-10-26 21:51 ` [PATCH 2/4] strip: Split out debug section relocation into separate helper functions Mark Wielaard
2018-10-26 21:51 ` [PATCH 1/4] strip: Always copy over any phdrs if there are any Mark Wielaard
2018-10-26 21:59 ` [PATCH 4/4] strip: Add --reloc-debug-sections-only option Mark Wielaard
2018-11-06 14:21   ` Mark Wielaard
2018-11-09 16:40     ` Mark Wielaard
2018-11-06 11:11 ` Add eu-strip " Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).