Blame SOURCES/valgrind-3.17.0-debuginfod.patch

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