From e8a83e931e09357437c29093ffeeab2afc79ad5c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Markus=20B=C3=B6ck?= Date: Wed, 15 Jul 2020 08:31:30 +0930 Subject: [PATCH] PR26198 MinGW failure to link regular object file and LTO object file PR 26198 * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin objects both before and after normal object files. * elflink.c (_bfd_elf_section_already_linked): Likewise. --- bfd/ChangeLog | 8 ++++++++ bfd/coffgen.c | 3 ++- bfd/elflink.c | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3cb4881febc..813e3f219bf 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2020-07-15 Markus Böck + Alan Modra + + PR 26198 + * coffgen.c (_bfd_coff_section_already_linked): Allow for plugin + objects both before and after normal object files. + * elflink.c (_bfd_elf_section_already_linked): Likewise. + 2020-07-10 Alan Modra * elf64-ppc.h (struct ppc64_elf_params): Add power10_stubs. diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 3291b693eb0..d49b2ff201e 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -2662,7 +2662,8 @@ _bfd_coff_section_already_linked (bfd *abfd, .gnu.linkonce.*.. */ if (((s_comdat != NULL) == (l_comdat != NULL) && strcmp (name, l->sec->name) == 0) - || (l->sec->owner->flags & BFD_PLUGIN) != 0) + || (l->sec->owner->flags & BFD_PLUGIN) != 0 + || (sec->owner->flags & BFD_PLUGIN) != 0) { /* The section has already been linked. See if we should issue a warning. */ diff --git a/bfd/elflink.c b/bfd/elflink.c index 998b72f2281..6978df56db3 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -14534,7 +14534,8 @@ _bfd_elf_section_already_linked (bfd *abfd, if (((flags & SEC_GROUP) == (l->sec->flags & SEC_GROUP) && ((flags & SEC_GROUP) != 0 || strcmp (name, l->sec->name) == 0)) - || (l->sec->owner->flags & BFD_PLUGIN) != 0) + || (l->sec->owner->flags & BFD_PLUGIN) != 0 + || (sec->owner->flags & BFD_PLUGIN) != 0) { /* The section has already been linked. See if we should issue a warning. */ -- 2.30.2