[binutils-gdb] ld: Discard .rel.* and .rela.* sections
H.J.Lu
hjl@sourceware.org
Fri Jul 20 16:59:00 GMT 2018
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d5f4da5e334dc4d87d7751a816c15d2bf4db3d43
commit d5f4da5e334dc4d87d7751a816c15d2bf4db3d43
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jul 20 09:52:35 2018 -0700
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.
Diff:
---
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 ba8a84f..573e777 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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.
diff --git a/ld/testsuite/ld-elf/reloc-discard.ld b/ld/testsuite/ld-elf/reloc-discard.ld
index b16b80a..1252bbb 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.*) }
}
More information about the Binutils-cvs
mailing list