summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunlian Jiang <yunlian@google.com>2016-05-17 11:33:06 -0700
committerYunlian Jiang <yunlian@google.com>2016-05-17 11:44:20 -0700
commit21efffa54e136e1b45d8016339bda25690b2b7fd (patch)
tree3fc94ba4a94bacfa87f11131c74f6278d5a192a1
parentd929cfd50d770364fd652d252abc19598b0cc84c (diff)
downloadtoolchain_binutils-21efffa54e136e1b45d8016339bda25690b2b7fd.tar.gz
toolchain_binutils-21efffa54e136e1b45d8016339bda25690b2b7fd.tar.bz2
toolchain_binutils-21efffa54e136e1b45d8016339bda25690b2b7fd.zip
GOLD/DWP: exit without segfault if the binary is not built with debug fission.
dwp segfaults when trying to get .dwp file from a binary built without debug fission. This patch fixes that. upstream thread is https://sourceware.org/ml/binutils/2016-05/msg00204.html BUG=None TEST=dwp still works with files built with debug fission and dwp does not segfault on files that are not built with debug fission.
-rw-r--r--binutils-2.25/gold/dwp.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/binutils-2.25/gold/dwp.cc b/binutils-2.25/gold/dwp.cc
index 121f37b1..9eef68ab 100644
--- a/binutils-2.25/gold/dwp.cc
+++ b/binutils-2.25/gold/dwp.cc
@@ -2427,6 +2427,10 @@ main(int argc, char** argv)
if (exe_filename == NULL && files.empty())
gold_fatal(_("no input files and no executable specified"));
+ // If there are no DWO files, there is nothing to do.
+ if (files.empty())
+ return EXIT_SUCCESS;
+
if (verify_only)
{
// Get list of DWO files in the DWP file and compare with