aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-09-30 05:23:20 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-09-30 05:23:35 -0700
commit04e433a8571e727108b8f1b9a04ba5c7ab20112c (patch)
tree483b73be7e54bcd7ffc04ee3ceef3919db100f38 /ld
parentc81946efc22dbbe97ef8c934a5367e37bf101c48 (diff)
downloadfsf-binutils-gdb-04e433a8571e727108b8f1b9a04ba5c7ab20112c.zip
fsf-binutils-gdb-04e433a8571e727108b8f1b9a04ba5c7ab20112c.tar.gz
fsf-binutils-gdb-04e433a8571e727108b8f1b9a04ba5c7ab20112c.tar.bz2
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.
Diffstat (limited to 'ld')
-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 3692527..134db8c 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+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-30 Jeremy Drake <sourceware-bugzilla@jdrake.com>
PR 26588
diff --git a/ld/plugin.c b/ld/plugin.c
index 5640b89..067551c 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))