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
On Sat, Dec 21, 2002 at 02:56:51AM +0000, Nick Clifton wrote:
> Hi H.J.
> > > I think that his point was that he did not want it to work. it was
> > > supposed to have triggered an error response from the linker and it
> > > did not.
> > Compiler accepts any valid source codes. But it doesn't mean the code
> > passed compiler is exactly the user wants. If the user doesn't want
> > it to work, should a flag be used in this case, instead the other way
> > around?
> I guess this is the real question. The patch gives the linker the
> ability to complain about input files in a format it does not
> recognise (and which it has not been told is the "binary" format).
> The question is - should the linker complain about such files by
> default or only if told to do so by a command line switch ?
> I believe that the linker should complain by default, since it will
> catch the case where the user has mistakenly given the linker the
> wrong kind of input files. It does mean however that if the user does
What is the definition of "wrong"? All the examples I have seen so far
don't look wrong to me.
> know what they are doing they now have to add a command line switch.
> I do not believe that this will any current users of the linker, or
> that if it does, the disruption will be minor. Do you know of any
> projects that might be affected by this change ? [Note - the linker
> will now accept "binary" format input files without issuing a warning
It is an existing feature of GNU ld which people may use. In the
testcase, I believe GNU ld produces a correct, working executable
for the given input.