From d5f4da5e334dc4d87d7751a816c15d2bf4db3d43 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 20 Jul 2018 09:52:35 -0700 Subject: [PATCH] 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. --- ld/ChangeLog | 5 +++++ ld/testsuite/ld-elf/reloc-discard.ld | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index ba8a84ff890..573e777f528 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2018-07-20 H.J. Lu + + * 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 PR ld/23428 diff --git a/ld/testsuite/ld-elf/reloc-discard.ld b/ld/testsuite/ld-elf/reloc-discard.ld index b16b80a2420..1252bbb8328 100644 --- a/ld/testsuite/ld-elf/reloc-discard.ld +++ b/ld/testsuite/ld-elf/reloc-discard.ld @@ -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.*) } } -- 2.30.2