summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2015-06-09 16:26:16 +0200
committerMark Wielaard <mjw@redhat.com>2015-06-10 14:14:57 +0200
commitcb499c489299de2b77472fc836a6b28ecf5361b9 (patch)
tree0a2a795274c24cd1de4489e40dec2d00e537dda8
parent9e3d5c2656c993e391cc126f9e1bb921e0af4873 (diff)
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 <mjw@redhat.com>
-rw-r--r--src/ChangeLog5
-rw-r--r--src/strip.c14
2 files changed, 17 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 59d87c8d..35c68c78 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-09 Mark Wielaard <mjw@redhat.com>
+
+ * strip.c (handle_ar): Mark as unused.
+ (process_file): Produce an error when trying to handle an ar.
+
2015-05-30 Mark Wielaard <mjw@redhat.com>
* elfcmp.c (main): Only call memcmp when d_size != 0.
diff --git a/src/strip.c b/src/strip.c
index d63b6a82..5e69334b 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: