* merge.cc (do_add_input_section): Correct pend value. Change
authorIan Lance Taylor <ian@airs.com>
Mon, 23 Mar 2009 21:15:08 +0000 (21:15 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 23 Mar 2009 21:15:08 +0000 (21:15 +0000)
message about last entry not being null terminated from error to
warning.

gold/ChangeLog
gold/merge.cc

index 1297e19e028b15d0ad1847b5d92571631bc76e26..1ccb0eb969a5663bff93785386e51fad4264798a 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2009-03-20  Mikolaj Zalewski  <mikolajz@google.com>
 
        * incremental.cc: New file.
index 1369938a557ae4cc5b37d5a208145cc0925d53b0..25ecc40c0e17c14b7ef6605a98ad6c3f7065912a 100644 (file)
@@ -465,7 +465,7 @@ Output_merge_string<Char_type>::do_add_input_section(Relobj* object,
   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_input_section(Relobj* object,
        {
          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;
            }
        }