From e511c9b19faec4d21aef49d12224316dea3d51eb Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Mon, 24 Aug 2015 13:02:39 +0100 Subject: objcopy/strip: Allow section patterns starting with '!'. For symbol matching, prefixing a pattern with '!' will indicate a non-matching pattern, however, this is not the case for section patterns. As a result it is not possible to say "apply this action to all sections except ...". With this commit the objcopy and strip tools now support '!' prefix for section patterns, so we can say: objcopy --remove-section="*" --remove-section="!.text*" Which will remove all sections, except those matching the pattern '.text*'. binutils/ChangeLog: * objcopy.c (find_section_list): Handle section patterns starting with '!' being a non-matching pattern. * doc/binutils.texi (objcopy): Give example of using '!' with --remove-section and --only-section. (strip): Give example of using '!' with --remove-section. * testsuite/binutils-all/data-sections.s: New file. * testsuite/binutils-all/only-section-01.d: New file. * testsuite/binutils-all/remove-section-01.d: New file. * testsuite/binutils-all/objcopy.exp: Run new tests. * NEWS: Mention new feature. --- binutils/ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'binutils/ChangeLog') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 3bf6972..f5b45d8 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,16 @@ +2016-07-14 Andrew Burgess + + * objcopy.c (find_section_list): Handle section patterns starting + with '!' being a non-matching pattern. + * doc/binutils.texi (objcopy): Give example of using '!' with + --remove-section and --only-section. + (strip): Give example of using '!' with --remove-section. + * testsuite/binutils-all/data-sections.s: New file. + * testsuite/binutils-all/only-section-01.d: New file. + * testsuite/binutils-all/remove-section-01.d: New file. + * testsuite/binutils-all/objcopy.exp: Run new tests. + * NEWS: Mention new feature. + 2016-07-09 Alan Modra PR binutils/20337 -- cgit v1.1