X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Faddr2line.c;h=11bbcd8f27d826ef48051eb0d7b62d55448badab;hb=aefd8b33d97bded58e51d75271f99e1eaec9fb28;hp=0de73982f54ffd0960d64a2e864a45af0b3c399e;hpb=0d0fb1ba5f0512ca8b670d3bdcf2083db355d3d7;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/addr2line.c b/binutils/addr2line.c index 0de73982f5..11bbcd8f27 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -1,6 +1,5 @@ /* addr2line.c -- convert addresses to line number and function name - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-2017 Free Software Foundation, Inc. Contributed by Ulrich Lauther This file is part of GNU Binutils. @@ -141,6 +140,14 @@ slurp_symtab (bfd *abfd) syms = xmalloc (storage); symcount = bfd_canonicalize_dynamic_symtab (abfd, syms); } + + /* PR 17512: file: 2a1d3b5b. + Do not pretend that we have some symbols when we don't. */ + if (symcount <= 0) + { + free (syms); + syms = NULL; + } } /* These global variables are used to pass information between @@ -424,6 +431,7 @@ main (int argc, char **argv) program_name = *argv; xmalloc_set_program_name (program_name); + bfd_set_error_program_name (program_name); expandargv (&argc, &argv);