[patch][gold] Remove empty Merge_map class

Rafael Espíndola rafael.espindola@gmail.com
Sun Feb 22 03:12:00 GMT 2015


ping. This is just deleting dead code.

On 17 February 2015 at 10:56, Rafael Espíndola
<rafael.espindola@gmail.com> wrote:
> Ping. A rebased patch is attached.
>
> On 6 February 2015 at 18:32, Rafael Espíndola
> <rafael.espindola@gmail.com> wrote:
>> When looking at the constant merging code to see if the
>> mapping could be reused for gc, the most confusing part for
>> me was the empty Merge_map class.
>>
>> It is only used as a key to implement is_merge_section_for (which is
>> only used by find_starting_output_address).
>>
>> Since it is just a key, we can use the Output_section_data as a key
>> instead. This patch does that. IMHO removing the indirection makes
>> things a bit easier to understand. It also removes the need for the
>> virtual do_is_merge_section_for.
>>
>> Last but not least, it makes some inefficiencies easier to spot. For
>> example,  Output_merge_data::do_add_input_section handles only one
>> input section and therefore only one merge map, but it does
>>
>>  object->add_merge_mapping(this, shndx, i, entsize, k);
>>
>> in a loop. It could extract Input_merge_map* before the loop.
>>
>> Cheers,
>> Rafael



More information about the Binutils mailing list