m68k: don't fail when linking in a binary object

Message ID 87a7fzu9qz.fsf@igel.home
State New
Headers show
Series
  • m68k: don't fail when linking in a binary object
Related show

Commit Message

Andreas Schwab May 6, 2019, 11:01 a.m.
This is used by glib to add some random data to the linked object.

Andreas.

	PR binutils/24523
	* elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Return TRUE if
	input or output is non-ELF.

---
 bfd/elf32-m68k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.21.0

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

Comments

Alan Modra May 8, 2019, 1:34 p.m. | #1
On Mon, May 06, 2019 at 01:01:56PM +0200, Andreas Schwab wrote:
> 	PR binutils/24523

> 	* elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Return TRUE if

> 	input or output is non-ELF.


OK.  If you like, it would be reasonable to extend this patch a little
and return true for non-m68k ELF.  For one way to do that, see
ppc64_elf_merge_private_bfd_data and is_ppc64_elf.

-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 9b34b62440..0f225224f9 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -1134,7 +1134,7 @@  elf32_m68k_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 
   if (   bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
-    return FALSE;
+    return TRUE;
 
   /* Get the merged machine.  This checks for incompatibility between
      Coldfire & non-Coldfire flags, incompability between different