ld: Discard .rel.* and .rela.* sections

On many targets, like x86, .rel.dyn/.rela.dyn section is combined from
different .rel/.rela sections by -z combreloc.  To discard dynamic
relocation section, we need to discard .rel.* and .rela.* sections
instead of .rel.dyn and .rela.dyn sections.

Note: This test fails for targets which issue a warning when dynamic
section is discarded.

	* testsuite/ld-elf/reloc-discard.ld: Discard .rel.* and .rela.*
	sections instead of .rel.dyn and .rela.dyn sections.
This commit is contained in:
H.J. Lu 2018-07-20 09:52:35 -07:00
parent 2d38991535
commit d5f4da5e33
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2018-07-20 H.J. Lu <hongjiu.lu@intel.com>
* testsuite/ld-elf/reloc-discard.ld: Discard .rel.* and .rela.*
sections instead of .rel.dyn and .rela.dyn sections.
2018-07-20 H.J. Lu <hongjiu.lu@intel.com>
PR ld/23428

View File

@ -2,5 +2,5 @@ SECTIONS
{
/* .dynamic needs to go first with MIPS IRIX-style emulations. */
.dynamic : { *(.dynamic) }
/DISCARD/ : { *(.rel.dyn) *(.rela.dyn) }
/DISCARD/ : { *(.rel.*) *(.rela.*) }
}