[PATCH][GOLD] Fix sorting of .init_array and .fini_array input sections.

Ian Lance Taylor iant@google.com
Mon Mar 1 20:45:00 GMT 2010


"Doug Kwan (關振德)" <dougkwan@google.com> writes:

> 2010/3/1 Ian Lance Taylor <iant@google.com>:
>
>> I don't think this is the right place for this.  I think you should do
>> it in the loop over sections in Sized_relobj::do_layout.  Perhaps you
>> could call a little function to change the type if appropriate.  I
>> think you should only change the type if the initial type is
>> SHT_PROGBITS.  You should also force .preinit_array to change from
>> SHT_PROGBITS to SHT_PREINIT_ARRAY.
>
> That means we need to make a copy of the section header because we may
> modify it.  That's okay?

Hmmm, good point.  OK, do it in Layout::layout then.  I want to move
the test on the name as high as reasonable, because the lower the
level of code, the harder it tends to be to find and maintain.

Ian



More information about the Binutils mailing list