From: Mark Wielaard Date: Tue, 9 Jun 2015 14:26:16 +0000 (+0200) Subject: strip: Just admit we don't support stripping ar archives for now. X-Git-Tag: elfutils-0.162~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb499c489299de2b77472fc836a6b28ecf5361b9;p=thirdparty%2Felfutils.git strip: Just admit we don't support stripping ar archives for now. We try to handle (in-place) stripping of ar archives, but since elf_clone doesn't really support cloning ar members and we don't handle reducing the size of the members, moving the offsets of other members. This causes crashes or writing garbage. Better to just admit that for now we don't support stripping archives. Call error when we see an ELF_K_AR file. https://bugzilla.redhat.com/show_bug.cgi?id=766156 https://lists.fedorahosted.org/pipermail/elfutils-devel/2009-August/000567.html Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 59d87c8d4..35c68c78b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-06-09 Mark Wielaard + + * strip.c (handle_ar): Mark as unused. + (process_file): Produce an error when trying to handle an ar. + 2015-05-30 Mark Wielaard * elfcmp.c (main): Only call memcmp when d_size != 0. diff --git a/src/strip.c b/src/strip.c index d63b6a822..5e69334bf 100644 --- a/src/strip.c +++ b/src/strip.c @@ -113,7 +113,7 @@ static int handle_elf (int fd, Elf *elf, const char *prefix, /* Handle all files contained in the archive. */ static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname, - struct timespec tvp[2]); + struct timespec tvp[2]) __attribute__ ((unused)); static int debug_fd = -1; static char *tmp_debug_fname = NULL; @@ -374,7 +374,17 @@ process_file (const char *fname) result = 1; } else - result = handle_ar (fd, elf, NULL, fname, preserve_dates ? tv : NULL); + { + /* We would like to support ar archives, but currently it just + doesn't work at all since we call elf_clone on the members + which doesn't really support ar members. + result = handle_ar (fd, elf, NULL, fname, + preserve_dates ? tv : NULL); + */ + error (0, 0, gettext ("%s: no support for stripping archive"), + fname); + result = 1; + } break; default: