This is the mail archive of the
mailing list for the binutils project.
Re: ld won't complain if asked to link obj files of different arches
- From: Nick Clifton <nickc at redhat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 17 Dec 2002 19:40:19 +0000
- Subject: Re: ld won't complain if asked to link obj files of different arches
- References: <email@example.com>
> If I run something like:
> mn10300-elf-gcc -c foo.c
> gcc -c bar.c # native gcc
> mn10300-elf-ld foo.o bar.o
> ld foo.o bar.o
> both links succeed!
> I was expecting some kind of error message from the linker stating
> that the object file was incompatible, but I don't get any, because
> bfd_arch_get_compatible is too lax about bfds of unknown architecture,
> so they end up considered to be compatible. Is this really desirable?
> Should we really get different behavior depending on whether we
> compile with or without --enable-targets=all?
It is not desirable, but I suspect that if we change the behavior
something will break. ie there are probably projects somewhere that
need this behavior.
What we might be able to do is allow ports to decide if they want to
support linking with an unknown architecture on a port by port basis.