Fix incorrect byte counts.
authorCary Coutant <ccoutant@gmail.com>
Thu, 12 Jan 2017 19:51:18 +0000 (11:51 -0800)
committerCary Coutant <ccoutant@gmail.com>
Thu, 12 Jan 2017 19:51:40 +0000 (11:51 -0800)
gold/
* object.cc (Sized_relobj_file): Fix byte counts for calls to memmem.

gold/ChangeLog
gold/object.cc

index 6cc97528a85972d0dcfc4b0227ff421beecefd12..991d7b8b8c8780f12041d2603be486f16374d039 100644 (file)
@@ -1,3 +1,7 @@
+2017-01-12  Cary Coutant  <ccoutant@gmail.com>
+
+       * object.cc (Sized_relobj_file): Fix byte counts for calls to memmem.
+
 2017-01-11  Cary Coutant  <ccoutant@gmail.com>
 
        PR gold/21040
index e900864771263567f32d08ae2a1b92e0eacb196d..4110686ff3146b6b655faee144cc486a159388e6 100644 (file)
@@ -816,9 +816,9 @@ Sized_relobj_file<size, big_endian>::do_find_special_sections(
   return (this->has_eh_frame_
          || (!parameters->options().relocatable()
              && parameters->options().gdb_index()
-             && (memmem(names, sd->section_names_size, "debug_info", 12) == 0
-                 || memmem(names, sd->section_names_size, "debug_types",
-                           13) == 0)));
+             && (memmem(names, sd->section_names_size, "debug_info", 11) == 0
+                 || memmem(names, sd->section_names_size,
+                           "debug_types", 12) == 0)));
 }
 
 // Read the sections and symbols from an object file.