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.


> From: Nick Clifton <nickc@cambridge.redhat.com>
> Date: 19 Jun 2001 17:13:57 +0100

> So what do you guys think.  Is there any reason not to apply this
> patch ?

Your patch looks fine to me, FWIW.  Thanks.

Though when you said to Ian:
> ... at this point in time we do not know which, if any, of the
> sections in the input bfd will be mapped into the output bfd, so we
> cannot reasonably check their flags.

you seemed to refer to section flags.  The HAS_RELOC file flag
is in the bfd.  Since I had done this following patch anyway, I
present it as a less restrictive alternative, given Ian's
statement that bfd can handle -r for any file formats, as long
as the input doesn't have relocs.

Either way, the documentation needs fixing.  I'll do that as
soon as we settle what we allow with ld -r.

	* ldlang.c (lang_check): Emit fatal error if relocatable link
	between different object flavours with relocations in input.

Index: ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.53
diff -p -c -r1.53 ldlang.c
*** ldlang.c	2001/06/19 14:39:02	1.53
--- ldlang.c	2001/06/19 16:21:18
*************** lang_check ()
*** 3520,3525 ****
--- 3520,3531 ----
  		   bfd_printable_name (input_bfd), input_bfd,
  		   bfd_printable_name (output_bfd));
  	}
+       else if (link_info.relocateable
+ 	       && bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd)
+ 	       && (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
+ 	einfo (_("%P%F: Relocatable linking with relocations 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

brgds, H-P


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