This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold][patch] Set the target in make_sized_incremental_binary
- From: Rafael Espindola <espindola at google dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Ian Lance Taylor <iant at google dot com>, Mikolaj Zalewski <mikolajz at google dot com>
- Date: Wed, 2 Dec 2009 16:20:56 -0500
- Subject: Re: [gold][patch] Set the target in make_sized_incremental_binary
- References: <38a0d8450912021319j29fdd396y99b7a8c6f7256e57@mail.gmail.com>
now with the patch.
2009/12/2 Rafael Espindola <espindola@google.com>:
> This patch sets the target in make_sized_incremental_binary. I think it is
> generally correct and we need something on these lines for
> incremental-dump: Since incremental-dump sees only one file, the target
> has to be set from it.
>
> 2009-12-02 ÂRafael Avila de Espindola Â<espindola@google.com>
>
> Â Â Â Â* incremental.cc (make_sized_incremental_binary): Set the target.
>
> Cheers,
> --
> Rafael Ãvila de EspÃndola
>
--
Rafael Ãvila de EspÃndola
diff --git a/gold/incremental.cc b/gold/incremental.cc
index 4af4ef3..6bcc657 100644
--- a/gold/incremental.cc
+++ b/gold/incremental.cc
@@ -326,6 +326,10 @@ make_sized_incremental_binary(Output_file* file,
Target* target = select_target(ehdr.get_e_machine(), size, big_endian,
ehdr.get_e_ident()[elfcpp::EI_OSABI],
ehdr.get_e_ident()[elfcpp::EI_ABIVERSION]);
+
+ if (!parameters->target_valid())
+ set_parameters_target(target);
+
if (target == NULL)
{
explain_no_incremental(_("unsupported ELF machine number %d"),