This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Binutuls is broken now.
- To: nickc at cambridge dot redhat dot com
- Subject: Re: Binutuls is broken now.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Tue, 19 Jun 2001 22:02:18 +0200
- CC: hans-peter dot nilsson at axis dot com, hjl at lucon dot org, binutils at sourceware dot cygnus dot com
> From: Nick Clifton <nickc@cambridge.redhat.com>
> Date: 19 Jun 2001 17:58:40 +0100
> Of course in theory the relocatable link may only be extracting
> non-reloc-associated sections from the input bfd, but I think that
> checking for this case is too much to ask.
Thanks. ;-)
> PS. I would suggest adding a comment explaining why it is not
> supported.
Now, that's my "doh"! I took the first of the comments in your
patch and tweaked it. This is what I installed:
* 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 19:45:52
*************** lang_check ()
*** 3520,3525 ****
--- 3520,3537 ----
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (output_bfd));
}
+ else if (link_info.relocateable
+ /* In general it is not possible to perform a relocatable
+ link between differing object formats when the input
+ file has relocations, because the relocations in the
+ input format may not have equivalent representations in
+ the output format (and besides BFD does not translate
+ relocs for other link purposes than a final link). */
+ && 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