This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Dead easy question - if you already know...
- From: Ian Lance Taylor <iant at google dot com>
- To: "Dave Korn" <dave dot korn at artimi dot com>
- Cc: <binutils at sourceware dot org>
- Date: Mon, 21 Apr 2008 17:16:58 -0700
- Subject: Re: Dead easy question - if you already know...
- References: <049e01c8a3d3$03d84070$2708a8c0@CAM.ARTIMI.COM>
"Dave Korn" <dave.korn@artimi.com> 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.
Ian