From 64f52b3ec1853d14293d5a461d7abc8bde5e3f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C4=81ng-ru=C3=AC=20S=C3=B2ng?= Date: Fri, 1 Nov 2019 14:47:55 -0700 Subject: Implement objcopy/strip --keep-section= llvm-objcopy and llvm-strip support an option --keep-section that keeps some sections from being removed. * objcopy.c (enum option_values): Add OPTION_KEEP_SECTION. (SECTION_CONTEXT_KEEP): Define. Adjust other SECTION_CONTEXT macros. (copy_usage): Describe --keep-section. (strip_usage): Likewise. (copy_main): Handle SECTION_CONTEXT_KEEP. (strip_main): Likewise. (is_strip_section_1): Likewise. * testsuite/binutils-all/objcopy.exp: Add tests. * testsuite/binutils-all/keep-section-1.d: New test driver file. * testsuite/binutils-all/keep-section-2.d: Likewise. * doc/binutils.texi: Document the new feature. * NEWS: Mention the new feature. --- binutils/NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'binutils/NEWS') diff --git a/binutils/NEWS b/binutils/NEWS index fd14d71..88b0489 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -3,6 +3,9 @@ * Add --output option to the "ar" program. This option can be used to specify the output directory when extracting members from an archive. +* Add --keep-section option to objcopy and strip. This option keeps the + specified section from being removed. + Changes in 2.33: * Add --source-comment[=] option to objdump which if present, -- cgit v1.1