[patch][gold] Remove empty Merge_map class

Rafael Espíndola rafael.espindola@gmail.com
Tue Mar 3 08:28:00 GMT 2015


> Thanks. This looks good, but let's take it one step further. The only
> exposure that Relobj::merge_map_ has outside the class is in reloc.cc:
>
> template<int size>
> void
> Merged_symbol_value<size>::initialize_input_to_output_map(
>     const Relobj* object,
>     unsigned int input_shndx)
> {
>   Object_merge_map* map = object->merge_map();
>   map->initialize_input_to_output_map<size>(input_shndx,
>                                             this->output_start_address_,
>                                             &this->output_addresses_);
> }
>
> // Get the output value corresponding to an input offset if we
> // couldn't find it in the hash table.
>
> template<int size>
> typename elfcpp::Elf_types<size>::Elf_Addr
> Merged_symbol_value<size>::value_from_output_section(
>     const Relobj* object,
>     unsigned int input_shndx,
>     typename elfcpp::Elf_types<size>::Elf_Addr input_offset) const
> {
>   section_offset_type output_offset;
>   bool found = object->merge_map()->get_output_offset(input_shndx,
>                                                       input_offset,
>                                                       &output_offset);
>   ...
>
> In the first case, let's just add an initialize_input_to_output_map()
> method to Relobj, and call it instead of first getting the merge_map.
> In the second case, you can now call object->merge_output_offset().
>
> Now you can remove Relobj::merge_map(), and you can also remove
> Relobj::set_merge_map(), instead just setting merge_map_ directly in
> Relobj::add_merge_mapping().
>
> Also, please write a ChangeLog entry.

Hi,

A new patch that includes the above improvements and a ChangeLog entry
is attached. Would you mind pushing it for me? I am at a business trip
this week and just noticed I never copied my ssh key to my laptop :-(

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 29647 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150303/0319a4e2/attachment.obj>


More information about the Binutils mailing list