This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold] Merging string literals with bigger alignment


> 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).

--Alexander

Attachment: merging_string_literals_03.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]