This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Binutuls is broken now.


On Tue, Jun 19, 2001 at 05:13:57PM +0100, Nick Clifton wrote:
> 
> Thus I am proposing that we apply the patch below.  It incorporates
> Hans-Pater's original patch to catch mixed format relocatable links,
> plus your patch to allow the binary format in otherwise homogeneous
> relocatable links, plus it adds a couple of comments to explain what
> it going on.
> 
> One thing I did miss out from H.J.'s patch was the tests to make sure
> that the input and/or output formats were not undefined.  It seemed to
> me that the tests were unnecessary since the earlier line has ensured
> that at least one of the formats must be defined, and trying to
> (relocatably) link an undefined format with a defined one is bound to
> fail.
> 
> So what do you guys think.  Is there any reason not to apply this
> patch ?
> 

Ian suggested to check the HAS_RELOC bit to allow any inputs without
relocations. Should that work?


H.J.
--
--- ldlang.c	Tue Jun 19 07:42:50 2001
+++ /tmp/ldlang.c	Tue Jun 19 09:20:54 2001
@@ -3520,6 +3520,13 @@ lang_check ()
 		   bfd_printable_name (input_bfd), input_bfd,
 		   bfd_printable_name (output_bfd));
 	}
+      else if (link_info.relocateable
+		 && (input_bfd->flags | HAS_RELOC) != 0
+		 && bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd))
+	einfo (_("%P%F: Relocatable linking from format %s (%B) to format %s
+	  (%B) is not supported\n"),
+	       bfd_get_target (input_bfd), input_bfd,
+	       bfd_get_target (output_bfd), output_bfd);
       else if (bfd_count_sections (input_bfd))
 	{
 	  /* If the input bfd has no contents, it shouldn't set the


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]