File gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch of Package gdb.783

Index: gdb-7.6.90.20140127/gdb/gdb_bfd.c
===================================================================
--- gdb-7.6.90.20140127.orig/gdb/gdb_bfd.c	2014-02-06 17:39:46.370096290 +0100
+++ gdb-7.6.90.20140127/gdb/gdb_bfd.c	2014-02-06 17:40:14.996127247 +0100
@@ -29,12 +29,14 @@
 #ifdef HAVE_ZLIB_H
 #include <zlib.h>
 #endif
+#ifndef __sparc__
 #ifdef HAVE_MMAP
 #include <sys/mman.h>
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *) -1)
 #endif
 #endif
+#endif
 
 typedef bfd *bfdp;
 DEF_VEC_P (bfdp);
@@ -210,6 +212,7 @@ free_one_bfd_section (bfd *abfd, asectio
 
   if (sect != NULL && sect->data != NULL)
     {
+#ifndef __sparc__
 #ifdef HAVE_MMAP
       if (sect->map_addr != NULL)
 	{
@@ -220,6 +223,7 @@ free_one_bfd_section (bfd *abfd, asectio
 	}
       else
 #endif
+#endif
 	xfree (sect->data);
     }
 }
@@ -371,6 +375,7 @@ gdb_bfd_map_section (asection *sectp, bf
   if (descriptor->data != NULL)
     goto done;
 
+#ifndef __sparc__
 #ifdef HAVE_MMAP
   if (!bfd_is_section_compressed (abfd, sectp))
     {
@@ -405,6 +410,7 @@ gdb_bfd_map_section (asection *sectp, bf
 	}
     }
 #endif /* HAVE_MMAP */
+#endif
 
   /* Handle compressed sections, or ordinary uncompressed sections in
      the no-mmap case.  */