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
This commit is contained in:
Ed Maste 2014-12-17 14:46:21 +00:00
parent 49506d6809
commit a356a1f51f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=275862

View File

@ -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();