public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED] strip: Use ELF_CHF_FORCE to recompress any sections that were uncompressed.
@ 2016-08-25 18:53 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2016-08-25 18:53 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]

Older gcc might create small .debug_pubtype. If such a section is compressed
then strip should use ELF_CHF_FORCE to return it to compressed state after it
is done with the section. Found by the run-strip-reloc.sh testcase on rhel6.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 src/ChangeLog | 4 ++++
 src/strip.c   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 835888d..e5b3b20 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-25  Mark Wielaard  <mjw@redhat.com>
+
+	* strip.c (handle_elf): Recompress with ELF_CHF_FORCE.
+
 2016-08-06  Mark Wielaard  <mjw@redhat.com>
 
 	* strip.c (handle_elf): Uncompress and recompress relocation target
diff --git a/src/strip.c b/src/strip.c
index f56554f..da093e9 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -1986,7 +1986,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
 	      gelf_update_shdr (scn, shdr);
 
 	      if (tcompress_type != 0)
-		if (elf_compress (tscn, tcompress_type, 0) != 1)
+		if (elf_compress (tscn, tcompress_type, ELF_CHF_FORCE) != 1)
 		  INTERNAL_ERROR (fname);
 	    }
 	}
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-25 18:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25 18:53 [COMMITTED] strip: Use ELF_CHF_FORCE to recompress any sections that were uncompressed 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).