This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][gold] Fix an internal error in the constructor of Target_arm.


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]