[patch][gold] Remove empty Merge_map class

Rafael Espíndola rafael.espindola@gmail.com
Fri Feb 27 17:09:00 GMT 2015


Ping. Lets focus on just this patch first. It is just deleting dead
code. To see it, noticed that:

* Merge_map is empty, so its methods (add_mapping, get_output_offset,
is_merge_section_for) don't use "this" and are really just free
standing functions. In this patch they are converted 1:1 into Relobj
methods since they all currently take a Relobj* as the first argument.

* The only use of a pointer to a Merge_map is in the comparison
"map->merge_map == merge_map" in
Object_merge_map::is_merge_section_for, which indicates that Merge_map
is now really just an ID.

* Merge_map is never allocated on its own, just as a member variable
of Eh_frame and Output_merge_base. Given that, we can just use a
pointer to Eh_frame/Output_merge_base and save the member. The common
base class of Eh_frame and Output_merge_base is Output_section_data,
so this patch s/Merge_map/Output_section_data/.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 24206 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150227/c60632cb/attachment.bin>


More information about the Binutils mailing list