summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain/elfcopy/main.c
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-12-17 14:46:21 +0000
committeremaste <emaste@FreeBSD.org>2014-12-17 14:46:21 +0000
commitdf55c61fa5caaef1f237ceb37d7870b642661de3 (patch)
tree2a9444210d7005d56879e6b28f82e418e10e0fa6 /contrib/elftoolchain/elfcopy/main.c
parent2df3680ba627a9459389ebaa25ef723618f5bab8 (diff)
downloadFreeBSD-src-df55c61fa5caaef1f237ceb37d7870b642661de3.zip
FreeBSD-src-df55c61fa5caaef1f237ceb37d7870b642661de3.tar.gz
Do not strip all when stripping an explicit symbol
When requested to strip specific symbols (-N flag) the default should be to strip nothing (other than the requested symbols). This is consistent with binutils strip(1). PR: 196038 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1327
Diffstat (limited to 'contrib/elftoolchain/elfcopy/main.c')
-rw-r--r--contrib/elftoolchain/elfcopy/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/elftoolchain/elfcopy/main.c b/contrib/elftoolchain/elfcopy/main.c
index 3689f35..240ca56 100644
--- a/contrib/elftoolchain/elfcopy/main.c
+++ b/contrib/elftoolchain/elfcopy/main.c
@@ -1109,7 +1109,8 @@ strip_main(struct elfcopy *ecp, int argc, char **argv)
if (ecp->strip == 0 &&
((ecp->flags & DISCARD_LOCAL) == 0) &&
- ((ecp->flags & DISCARD_LLABEL) == 0))
+ ((ecp->flags & DISCARD_LLABEL) == 0) &&
+ lookup_symop_list(ecp, NULL, SYMOP_STRIP) == NULL)
ecp->strip = STRIP_ALL;
if (optind == argc)
strip_usage();
OpenPOWER on IntegriCloud