[PATCH] ia64: don't fail when converting binary into ELF

Sergei Trofimovich slyfox@gentoo.org
Thu Dec 26 10:40:00 GMT 2019


From: Sergei Trofimovich <siarheit@google.com>

In ld/PR25316 ia64 is a rare target that fails the following test:
  $ echo hi > hello.123
  $ ia64-unknown-linux-gnu-ld -r -b binary hello.123 -o hello.o
  ia64-unknown-linux-gnu-ld: failed to merge target specific data of file hello.123

There is no need to support binary merging explicitly (as other targets).

bfd/ChangeLog
2019-12-26  Sergei Trofimovich <siarheit@google.com>

        * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
        on binary inputs ld/PR25316.
---
 bfd/ChangeLog    | 5 +++++
 bfd/elfnn-ia64.c | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 073bbb6f2b..5448af5305 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-26  Sergei Trofimovich <siarheit@google.com>
+
+	* elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
+	on binary inputs ld/PR25316.
+
 2019-12-23  Alan Modra  <amodra@gmail.com>
 
 	* vms-alpha.c (add_symbol): Add "max" parameter.  Error on string
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 459d986c03..338fd5ff93 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -4740,10 +4740,9 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
   flagword in_flags;
   bfd_boolean ok = TRUE;
 
-  /* Don't even pretend to support mixed-format linking.  */
   if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
-    return FALSE;
+    return TRUE;
 
   in_flags  = elf_elfheader (ibfd)->e_flags;
   out_flags = elf_elfheader (obfd)->e_flags;
-- 
2.24.1



More information about the Binutils mailing list