This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
incongruency in architecture mismatch linker warnings/errors
- From: Doug Evans <dje at transmeta dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 20 Jan 2003 12:09:25 -0800
- Subject: incongruency in architecture mismatch linker warnings/errors
It's odd that if the architectures (or mach's) are incompatible during
a relocatable link it's automatically an error whereas in a final link
it's only a warning and then only if the user asks for it.
Is there any reasoning behind this?
ldlang.c:
if ((link_info.relocateable || link_info.emitrelocations)
&& (compatible == NULL
|| 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);
/* einfo with %F exits. */
}
if (compatible == NULL)
{
if (command_line.warn_mismatch)
einfo (_("%P: warning: %s architecture of input file `%B' is incompatible with %s output\n"),
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (output_bfd));
}
[the comment above this code refers to mixing formats, but that's
not the context of this discussion which is mixing different mach's]
Plus, it would be extremely useful if the first error message
included the printable names (for the `compatible == NULL' case).
Perhaps the thing to do is split up the first `if' into two,
one for `compatible == NULL' and another for
`bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd)'.