bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/22789] addr2line can't determine function names in mips bi


From: address@hidden
Subject: [Bug binutils/22789] addr2line can't determine function names in mips binaries compiled with -gline-tables-only
Date: Mon, 05 Feb 2018 13:15:59 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22789

--- Comment #1 from Miloš Stojanović <address@hidden> ---
This patch should solves it. Added additional check to see if function name was
retrieved successfully, if not, a call is made to function that retrieves it.
Solution is taken from generic _bfd_elf_find_nearest_line function from elf.c.

diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 285401367d..feed1f4928 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -12655,15 +12655,18 @@ _bfd_mips_elf_find_nearest_line (bfd *abfd, asymbol
**symbols,
   if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
                                     filename_ptr, functionname_ptr,
                                     line_ptr, discriminator_ptr,
-                                    dwarf_debug_sections,
-                                    ABI_64_P (abfd) ? 8 : 0,
-                                    &elf_tdata (abfd)->dwarf2_find_line_info))
-    return TRUE;
-
-  if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset,
-                                    filename_ptr, functionname_ptr,
-                                    line_ptr))
-    return TRUE;
+                                    dwarf_debug_sections,ABI_64_P (abfd) ? 8 :
0,
+                                    &elf_tdata (abfd)->dwarf2_find_line_info)
+      || _bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset,
+                                       filename_ptr, functionname_ptr,
+                                       line_ptr))
+    {
+      if (!*functionname_ptr)
+       _bfd_elf_find_function (abfd, symbols, section, offset,
+                               *filename_ptr ? NULL : filename_ptr,
+                               functionname_ptr);
+      return TRUE;
+    }

   msec = bfd_get_section_by_name (abfd, ".mdebug");
   if (msec != NULL)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]