From: Steiner H Gunderson Date: Tue, 22 Mar 2022 15:32:32 +0000 (+0000) Subject: Fix return code in _bfd_dwarf2_find_nearest_line(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=86ed2a5eaef2d604c163031f4f355d3a8699f3d8;p=binutils-gdb.git Fix return code in _bfd_dwarf2_find_nearest_line(). * dwarf2.c (_bfd_dwarf2_find_nearest_line): if a function name is found, but no line number info, then return a result of 2. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fcf5abad5a1..86d42b2d639 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2022-03-22 Steiner H Gunderson + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): if a function name is + found, but no line number info, then return a result of 2. + 2022-03-21 Steiner H Gunderson PR 28978 diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index bb176798f9a..8b5ac6012e1 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -5267,7 +5267,11 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd, done: if (functionname_ptr && function && function->is_linkage) - *functionname_ptr = function->name; + { + *functionname_ptr = function->name; + if (!found) + found = 2; + } else if (functionname_ptr && (!*functionname_ptr || (function && !function->is_linkage)))