This is the mail archive of the binutils@sourceware.org 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: autoselecting bfd based on input objects


Mike Frysinger <vapier@gentoo.org> writes:

> From looking at a few targets, i dont think anyone does this, or i just missed 
> it.  is it possible for ld to check the incoming elf objects and select an 
> appropriate bfd target before it's too late ?  in the Blackfin case, we 
> distinguish object formats using ELF flags, so we know which bfd is 
> appropriate as soon as we read the ELF header ...

It is possible in principle, but there is no actual support for it.
GNU ld has a default target, typically specified by the linker script,
and that is the target which it will generate.  If the inputs have a
different format, it will still do the link, but the input file
formats won't affect the output format.

gold works differently.  It sets the format of the output file based
on the format of the input files.  Unlike GNU ld, gold refuses to link
an input file which has a different format from the output file, with
the exception of files for which -b binary is in effect.

Ian


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