[patch][gold] Change how we compute merge mapping for strings

Rafael Espíndola rafael.espindola@gmail.com
Wed May 20 15:12:00 GMT 2015


Currently we first record the offset and hash of each string. We then
walk that computing the size from the difference in the offsets.

This doesn't work if not every string is kept, which is what I am
trying to do (gc unused parts of SHF_MERGE sections).

With the attached patch we first add a mapping that is missing the
output offset and once the strings are merged we just set the output
offset.

Cheers,
Rafael

2015-05-20  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>

* merge.cc (do_add_input_section): Create mappings with no output
offset.
(finalize_merged_data): Set the output offsets.
* merge.h (Merged_string): Delete.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 3798 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150520/b4b9a52c/attachment.bin>


More information about the Binutils mailing list