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]
Other format: [Raw text]

Re: ld won't complain if asked to link obj files of different arches


Hi Alex,

> 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.

Cheers
        Nick


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