aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2017-11-08 14:03:55 -0800
committerEric Christopher <echristo@gmail.com>2018-04-04 14:04:28 -0700
commitaf0200d544c0a00a805f2ed86e9e5776cca22266 (patch)
tree33643b72937a11039799475520c5f7ad24ede8d2
parent3fa1ac0931fcd8a7683e45da6c29b984ec8feeb6 (diff)
downloadbinutils-af0200d544c0a00a805f2ed86e9e5776cca22266.zip
binutils-af0200d544c0a00a805f2ed86e9e5776cca22266.tar.gz
binutils-af0200d544c0a00a805f2ed86e9e5776cca22266.tar.bz2
Apply:
2017-11-08 Kyle Butt <iteratee@google.com> * object.cc (do_find_special_sections): Fix a thinko with memmem return values and check for != NULL rather than == 0.
-rw-r--r--gold/ChangeLog8
-rw-r--r--gold/object.cc4
2 files changed, 10 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index b48c279..ddcc0d7 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,11 @@
+2018-04-04 Eric Christopher <echristo@gmail.com>
+
+ Apply from master:
+ 2017-11-08 Kyle Butt <iteratee@google.com>
+
+ * object.cc (do_find_special_sections): Fix a thinko with memmem return
+ values and check for != NULL rather than == 0.
+
2018-03-20 Sriraman Tallam <tmsriram@google.com>
Apply from master:
diff --git a/gold/object.cc b/gold/object.cc
index 4110686..0135651 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -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", 11) == 0
+ && (memmem(names, sd->section_names_size, "debug_info", 11) != NULL
|| memmem(names, sd->section_names_size,
- "debug_types", 12) == 0)));
+ "debug_types", 12) != NULL)));
}
// Read the sections and symbols from an object file.