summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-09-30 05:23:20 -0700
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-02-07 02:08:35 +0200
commit09ab5a9de795550b8ce0bf187be85ceed6c39f45 (patch)
tree532b528716f4c79bf53445f654c476809354081e
parentGentoo: Pass --hash-style=sysv to ld in the testsuite (diff)
downloadbinutils-gdb-09ab5a9de795550b8ce0bf187be85ceed6c39f45.tar.gz
binutils-gdb-09ab5a9de795550b8ce0bf187be85ceed6c39f45.tar.bz2
binutils-gdb-09ab5a9de795550b8ce0bf187be85ceed6c39f45.zip
ld: Override the IR definition for non-ELF targets
For non-ELF targets, override the IR definition before all LTO symbols have been read. PR ld/26675 * plugin.c (plugin_notice): Override the IR definition before all LTO symbols have been read for non-ELF targets. (cherry picked from commit 04e433a8571e727108b8f1b9a04ba5c7ab20112c)
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/plugin.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ae4eb118e67..f685cce75f7 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -121,6 +121,12 @@
(PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS),
(PARSE_AND_LIST_ARGS_CASES): Support --no-pcrel-optimize.
+2020-09-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/26675
+ * plugin.c (plugin_notice): Override the IR definition before
+ all LTO symbols have been read for non-ELF targets.
+
2020-09-19 Nick Clifton <nickc@redhat.com>
This is the 2.35.1 point release.
diff --git a/ld/plugin.c b/ld/plugin.c
index d709ee10fe7..32d6ed46640 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -1436,8 +1436,10 @@ plugin_notice (struct bfd_link_info *info,
this by making the symbol appear to be undefined.
NB: We change the previous definition in the IR object to
- undefweak only after all LTO symbols have been read. */
- else if (info->lto_all_symbols_read
+ undefweak only after all LTO symbols have been read or for
+ non-ELF targets. */
+ else if ((info->lto_all_symbols_read
+ || bfd_get_flavour (abfd) != bfd_target_elf_flavour)
&& (((h->type == bfd_link_hash_defweak
|| h->type == bfd_link_hash_defined)
&& is_ir_dummy_bfd (sym_bfd = h->u.def.section->owner))