ld: Discard .rel.* and .rela.* sections
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 20 Jul 2018 16:52:35 +0000 (09:52 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 20 Jul 2018 16:58:45 +0000 (09:58 -0700)
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
ld/testsuite/ld-elf/reloc-discard.ld

index ba8a84f..573e777 100644 (file)
@@ -1,5 +1,10 @@
 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
        * testsuite/ld-elf/linux-x86.S: New file.
        * testsuite/ld-elf/linux-x86.exp: Likewise.
index b16b80a..1252bbb 100644 (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.*) }
 }