Support objcopy --remove-section=.relaFOO

* objcopy.c (handle_remove_section_option): Don't require a dot
	after .rela and .rel to handle a possible relocation section.
	* testsuite/binutils-all/remove-relocs-07.s,
	* testsuite/binutils-all/remove-relocs-07.d,
	* testsuite/binutils-all/remove-relocs-08.d: New tests.
	* testsuite/binutils-all/remove-relocs-01.d,
	* testsuite/binutils-all/remove-relocs-04.d,
	* testsuite/binutils-all/remove-relocs-05.d,
	* testsuite/binutils-all/remove-relocs-06.d: Exclude mips64-openbsd.
This commit is contained in:
Alan Modra
2018-09-12 14:57:48 +09:30
parent a4b9568c7e
commit c12d9fa2af
9 changed files with 39 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-relocations=.data.relocs.01
#readelf: -r
#notarget: "mips64*-*-openbsd*"
Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
.*

View File

@@ -2,6 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-relocations=.data.relocs.0\[12\]
#readelf: -r
#notarget: "mips64*-*-openbsd*"
Relocation section '\.rela?\.data\.relocs\.03' at offset 0x[0-9a-f]+ contains 3 entries:
.*

View File

@@ -2,6 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-section=.rela.data.relocs.01 --remove-section=.rel.data.relocs.01
#readelf: -r
#notarget: "mips64*-*-openbsd*"
Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
.*

View File

@@ -2,6 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-relocations=.data.relocs.* --remove-relocations=!.data.relocs.02
#readelf: -r
#notarget: "mips64*-*-openbsd*"
Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
.*

View File

@@ -0,0 +1,6 @@
#PROG: objcopy
#source: remove-relocs-07.s
#objcopy: --remove-relocations=FOO
#readelf: -r
There are no relocations in this file\.

View File

@@ -0,0 +1,2 @@
.section "FOO","aw",%progbits
.dc.a x

View File

@@ -0,0 +1,6 @@
#PROG: objcopy
#source: remove-relocs-07.s
#objcopy: --remove-section=.relFOO --remove-section=.relaFOO
#readelf: -r
There are no relocations in this file\.