Blame SOURCES/valgrind-3.17.0-debuginfod.patch

e7bd38
commit 93104368952c37268da724231487058ea3eaf1dc
e7bd38
Author: Tom Hughes <tom@compton.nu>
e7bd38
Date:   Thu May 20 17:16:06 2021 +0100
e7bd38
e7bd38
    Don't look for separate debuginfo if the image has a .debug_info section
e7bd38
    
e7bd38
    Fixes BZ#435908
e7bd38
e7bd38
diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
e7bd38
index b0f062ddc..e424e3e7e 100644
e7bd38
--- a/coregrind/m_debuginfo/readelf.c
e7bd38
+++ b/coregrind/m_debuginfo/readelf.c
e7bd38
@@ -2879,13 +2879,15 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
e7bd38
       /* Look for a build-id */
e7bd38
       HChar* buildid = find_buildid(mimg, False, False);
e7bd38
 
e7bd38
-      /* Look for a debug image that matches either the build-id or
e7bd38
+      /* If we don't have a .debug_info section in the main image then
e7bd38
+         look for a debug image that matches either the build-id or
e7bd38
          the debuglink-CRC32 in the main image.  If the main image
e7bd38
          doesn't contain either of those then this won't even bother
e7bd38
          to try looking.  This looks in all known places, including
e7bd38
          the --extra-debuginfo-path if specified and on the
e7bd38
          --debuginfo-server if specified. */
e7bd38
-      if (buildid != NULL || debuglink_escn.img != NULL) {
e7bd38
+      if (debug_info_escn.img == NULL &&
e7bd38
+          (buildid != NULL || debuglink_escn.img != NULL)) {
e7bd38
          /* Do have a debuglink section? */
e7bd38
          if (debuglink_escn.img != NULL) {
e7bd38
             UInt crc_offset