Fix return code in _bfd_dwarf2_find_nearest_line().
authorSteiner H Gunderson <steinar+sourceware@gunderson.no>
Tue, 22 Mar 2022 15:32:32 +0000 (15:32 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 22 Mar 2022 15:32:32 +0000 (15:32 +0000)
* dwarf2.c (_bfd_dwarf2_find_nearest_line): if a function name is
found, but no line number info, then return a result of 2.

bfd/ChangeLog
bfd/dwarf2.c

index fcf5abad5a19f1f0361a7b25abf6fc4bc851c4ce..86d42b2d6391de4d3233a422d9a9770f2e78e073 100644 (file)
@@ -1,3 +1,8 @@
+2022-03-22  Steiner H Gunderson  <steinar+sourceware@gunderson.no>
+
+       * 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  <steinar+sourceware@gunderson.no>
 
        PR 28978
index bb176798f9a21d27d694967820931a28e9946f6c..8b5ac6012e13a9a9637cb0ad69664c167a083949 100644 (file)
@@ -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)))