[gold] Merging string literals with bigger alignment

Cary Coutant ccoutant@google.com
Fri May 3 05:58:00 GMT 2013


> Ah!  Take a look at merge.cc:545.  len is set for the first string
> and then the same value used for all subsequent strings.  The
> shadowing of vars is horrible too.  A final nit: If the last string in
> the section is missing a terminator, I think input_size_ ought to
> include the missing terminator.
>
> Oh, and the loop doesn't terminate due to pt < pend0 until we wrap..
> (gdb) p len
> $3 = -97 '\237'
> (gdb) p sizeof(len)
> $4 = 1

Ouch -- all issues that I should have caught before committing, and
probably introduced as a result of my review comments. Sorry for that.

>         * merge.cc (Output_merge_string::do_add_input_section): Correct
>         scan for number of strings.  Rename vars to avoid shadowing.
>         Include missing terminator in input_size_.

This is OK. Thanks to you and HJ for tracking these down.

-cary



More information about the Binutils mailing list