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


On Wednesday 23 April 2008, Ian Lance Taylor wrote:
> 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.

more just curiousness and streamlining of things for Blackfin ... not a real 
need.  this plus Daniel's feedback says that it's much more of a hassle today 
than it's worth [to me] to do with GNU ld.  maybe at some point we'll take a 
look at Blackfin/gold, but not anytime remotely soon (it certainly has 
sounded promising).

the Blackfin bfds will check the ELF header to make sure that the incoming 
objects match the bfd and if they dont, you'll get an appropriate error about 
mixing object formats.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


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