summaryrefslogtreecommitdiffstats
path: root/src/strip.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2015-06-09 16:26:16 +0200
committerMark Wielaard <[email protected]>2015-06-10 14:14:57 +0200
commitcb499c489299de2b77472fc836a6b28ecf5361b9 (patch)
tree0a2a795274c24cd1de4489e40dec2d00e537dda8 /src/strip.c
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 <[email protected]>
Diffstat (limited to 'src/strip.c')
-rw-r--r--src/strip.c14
1 files changed, 12 insertions, 2 deletions
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: