[gold] Merging string literals with bigger alignment

Alexander Ivchenko aivchenk@gmail.com
Tue Mar 26 11:23:00 GMT 2013

> Also, when processing the section in
> Output_merge_string::do_add_input_section, we count the strings in the
> section essentially by counting the null characters. This will count
> each padding byte as a separate string, so we'll get an inflated
> estimate of the number of strings. If we accept the above convention,
> the compiler should never point to any of these (unaligned) padding
> bytes as a null string, so we shouldn't need to count them or call
> add_with_length_and_alignment for all those null strings. In other
> words, once we add a string, we should skip ahead to the next
> alignment boundary.
> -cary

Thank you, that sounds correct to me, I attached the new version
that gives a warning if we encounter an incorrectly aligned string.
Also we don't count padding here (except for the padding in the end
of the section).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: merging_string_literals_03.patch
Type: application/octet-stream
Size: 19056 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20130326/82db3998/attachment.obj>

More information about the Binutils mailing list