mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
e511c9b19f
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.
18 lines
335 B
ArmAsm
18 lines
335 B
ArmAsm
.section ".data.aa.01", "aw"
|
|
.word 0x1
|
|
|
|
.section ".data.aa.02", "aw"
|
|
.word 0x2
|
|
|
|
.section ".data.aa.03", "aw"
|
|
.word 0x3
|
|
|
|
.section ".data.bb.01", "aw"
|
|
.word 0x4
|
|
|
|
.section ".data.bb.02", "aw"
|
|
.word 0x5
|
|
|
|
.section ".data.bb.03", "aw"
|
|
.word 0x6
|