x86: Use a normal input file with compatible relocation
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 18 Apr 2018 01:11:21 +0000 (18:11 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 18 Apr 2018 01:11:21 +0000 (18:11 -0700)
Use a normal input file with compatible relocation to hold linker
created sections,

PR ld/23055
* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a
normal input file with compatible relocation.

bfd/ChangeLog
bfd/elfxx-x86.c

index afa66e0c5f09b43fed5c2dd7c4ba5cf63653788f..8a9b96608be8b0e07219409b645ae2318cc178c7 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/23055
+       * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a
+       normal input file with compatible relocation.
+
 2018-04-18  Alan Modra  <amodra@gmail.com>
 
        * Makefile.am: Remove support for assorted i386 aout and coff targets.
index 5f55c948edc55bff8b0ccf52387f1af6163418cb..40157b8ed769d98078b4a5966a66f52a89d74d26 100644 (file)
@@ -2518,7 +2518,9 @@ error_alignment:
               abfd = abfd->link.next)
            if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
                && (abfd->flags
-                   & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)
+                   & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0
+               && bed->relocs_compatible (abfd->xvec,
+                                          info->output_bfd->xvec))
              {
                htab->elf.dynobj = abfd;
                dynobj = abfd;