This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][gold] Fix an internal error in the constructor of Target_arm.
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Igor Kudrin <ikudrin at accesssoftek dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, Doug Kwan <dougkwan at google dot com>
- Date: Mon, 19 Dec 2016 15:09:35 -0800
- Subject: Re: [PATCH][gold] Fix an internal error in the constructor of Target_arm.
- Authentication-results: sourceware.org; auth=none
- References: <1481911749172.28572@accesssoftek.com>
> In some cases, a Target object may be created before all the options
> are read, for instance, if the used linker script contains
> an OUTPUT_FORMAT statement. Consequently, the initialization for target
> relocations cannot be done in the constructor and should be delayed.
There's a hook Target::do_select_as_default_target() for
initializations like this. It isn't called until we are reading the
first object file, which is after the command line options have all
been parsed.
I think a much simpler fix is to move the code that initializes
target1_reloc_ and target2_reloc_ from the constructor into
Target_arm::do_select_as_default_target().
-cary