This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld --print-output-format switch
- From: Ian Lance Taylor <iant at google dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 02 Jul 2011 21:57:23 -0700
- Subject: Re: ld --print-output-format switch
- References: <20110611080608.E9F2C627E1@magilla.sf.frob.com>
Roland McGrath <roland@hack.frob.com> writes:
> This adds an ld option --print-output-format. The intent is to provide
> some technique better than ld --verbose and matching the OUTPUT_FORMAT
> command at the beginning of the linker script. (Library packages building
> a trivial input-only linker script need to give it the right OUTPUT_FORMAT
> command to ensure it gets accepted or skipped appropriately for the current
> target in biarch installations.)
>
> This emits just one target, never a triple as OUTPUT_FORMAT could take
> for endian-switchable targets. I think it will emit the right one when
> used with -EB or -EL on configurations where those are meaningful, but I
> haven't tested such a target.
>
> Ok for trunk?
>
> If this goes in, someone should implement it for gold as well.
> It was not very obvious to me how to go about it there.
In general I like this idea and I would like somebody to approve it (I
don't approve many binutils patches these days outside of gold).
However, I don't see why this will do the right thing when used with -EB
or -EL, and it seems to me that this matters. Your patch prints
default_target, but as far as I can see -EB/-EL only affect
output_target. I think this does need to be tested to ensure that
-EL/-EB work correctly.
Ian