Dead easy question - if you already know...

Ian Lance Taylor
Tue Apr 22 14:08:00 GMT 2008

"Dave Korn" <> writes:

>   I kind of already know that the answer is "yes", but I don't understand the
> logic behind it:
>   The standard idiom in bfd to find out if you're doing a relocatable or final
> link is to test if the output bfd pointer is NULL; if so, you're doing a final
> link, else you're doing a relocatable one.
>   But why?  Where's the output going, if not to an output bfd?

It is indeed going to an output BFD.  But that output BFD is not
passed to the relocation routines when doing a final link.

There is no good reason for this.  It could just as well be a boolean
flag.  Perhaps there was some need for the output_bfd before the
linker was rewritten around 1994 or so.


More information about the Binutils mailing list