This is the mail archive of the
mailing list for the binutils project.
Re: RFC: [PATCH] Add output_type to bfd_link_info
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 18 Aug 2015 14:18:47 +0930
- Subject: Re: RFC: [PATCH] Add output_type to bfd_link_info
- Authentication-results: sourceware.org; auth=none
- References: <20150817154337 dot GA21275 at intel dot com>
On Mon, Aug 17, 2015 at 08:43:38AM -0700, H.J. Lu wrote:
> The "shared" field in bfd_link_info is set for both DSO and and PIE.
> There are separate fields for executable and relocatable outputs. This
> patch adds an "output_type" field:
> enum output_type
> type_unknown = 0,
> and a "pic" field to bfd_link_info to replace shared, executable and
> relocatable fields so that we can use the "output_type" field to check
> for output type and the "pic" field check if output is PIC. Macros:
> are provided to check for output features.
> Any comments, objections, feedbacks?
Good! I started a patch like this a while ago, so you've saved me the
trouble of finishing my work. :)
Some comments on the patch itself:
I think you can delete type_unknown, making type_executable the
first enum (value 0) which happens to be the correct default.
I'd like to see the macros used in ld/, eg. instead of
"link_info.type != type_relocatable" write
The reason for that is consistency, so grep over bfd/ and ld/ can
more easily pick up given output types, and to make it easy to
change the underlying flag bits.
I spotted a few places that can be optimised but rather than list them
here I'll commit a followup patch.
Australia Development Lab, IBM