Blame SOURCES/valgrind-3.17.0-debuginfod.patch

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