This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold] "entry in mergeable string section not null terminated"
Ian Lance Taylor <iant@google.com> writes:
> Peter, would
> you be interested in trying such a patch? Change this line in
> gold/merge.cc
>
> object->error(_("entry in mergeable string section "
> "not null terminated"));
>
> to something like
>
> gold_warning(_("%s: entry in mergeable string section "
> "not null terminated"),
> object->name().c_str());
>
> Ian
Since Peter said this worked for him, I have committed this patch. I
also noticed that pend is set incorrectly for sections holding
multi-byte strings, and I fixed that.
2009-03-23 Ian Lance Taylor <iant@google.com>
* merge.cc (do_add_input_section): Correct pend value. Change
message about last entry not being null terminated from error to
warning.
Index: merge.cc
===================================================================
RCS file: /cvs/src/src/gold/merge.cc,v
retrieving revision 1.29
diff -p -u -r1.29 merge.cc
--- merge.cc 8 Apr 2008 18:46:43 -0000 1.29
+++ merge.cc 23 Mar 2009 21:14:19 -0000
@@ -465,7 +465,7 @@ Output_merge_string<Char_type>::do_add_i
const unsigned char* pdata = object->section_contents(shndx, &len, false);
const Char_type* p = reinterpret_cast<const Char_type*>(pdata);
- const Char_type* pend = p + len;
+ const Char_type* pend = p + len / sizeof(Char_type);
if (len % sizeof(Char_type) != 0)
{
@@ -485,8 +485,10 @@ Output_merge_string<Char_type>::do_add_i
{
if (pl >= pend)
{
- object->error(_("entry in mergeable string section "
- "not null terminated"));
+ gold_warning(_("%s: last entry in mergeable string section '%s' "
+ "not null terminated"),
+ object->name().c_str(),
+ object->section_name(shndx).c_str());
break;
}
}