mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
64f52b3ec1
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.
11 lines
222 B
Makefile
11 lines
222 B
Makefile
#PROG: objcopy
|
|
#source: data-sections.s
|
|
#objcopy: --remove-section=.data.aa.* --keep-section=.data.aa.*
|
|
#readelf: -WS
|
|
|
|
#...
|
|
\[ [0-9]+\] \.data\.aa\.01.*
|
|
\[ [0-9]+\] \.data\.aa\.02.*
|
|
\[ [0-9]+\] \.data\.aa\.03.*
|
|
#...
|