Blame SOURCES/binutils-2.23.52.0.1-find-separate-debug-file.patch

1a405f
--- a/bfd/opncls.c	2013-03-14 11:25:30.338306122 +0000
1a405f
+++ b/bfd/opncls.c	2013-03-14 12:20:21.686397360 +0000
1a405f
@@ -1297,6 +1297,8 @@
1a405f
       bfd_malloc (strlen (debug_file_directory) + 1
1a405f
                   + (canon_dirlen > dirlen ? canon_dirlen : dirlen)
1a405f
                   + strlen (".debug/")
1a405f
+#define FEDORA_LIB_DEBUG_DIR "/usr/lib/debug/"
1a405f
+		  + strlen (FEDORA_LIB_DEBUG_DIR) + strlen ("usr/")
1a405f
                   + strlen (base)
1a405f
                   + 1);
1a405f
   if (debugfile == NULL)
1a405f
@@ -1332,6 +1334,26 @@
1a405f
   if (check_func (debugfile, crc32))
1a405f
     goto found;
1a405f
 
1a405f
+  /* Then try in the global debug dir for Fedora libraries.  */
1a405f
+  sprintf (debugfile, "%s%s%s", FEDORA_LIB_DEBUG_DIR, dir, base);
1a405f
+  if (separate_debug_file_exists (debugfile, crc32))
1a405f
+    {
1a405f
+      free (base);
1a405f
+      free (dir);
1a405f
+      free (canon_dir);
1a405f
+      return debugfile;
1a405f
+    }
1a405f
+
1a405f
+  /* Then try in the usr subdirectory of the global debug dir for Fedora libraries.  */
1a405f
+  sprintf (debugfile, "%s/usr%s%s", FEDORA_LIB_DEBUG_DIR, dir, base);
1a405f
+  if (separate_debug_file_exists (debugfile, crc32))
1a405f
+    {
1a405f
+      free (base);
1a405f
+      free (dir);
1a405f
+      free (canon_dir);
1a405f
+      return debugfile;
1a405f
+    }
1a405f
+  
1a405f
   /* Then try in the global debugfile directory.  */
1a405f
   strcpy (debugfile, debug_file_directory);
1a405f
   dirlen = strlen (debug_file_directory) - 1;