--- libelf/gelf_getsym.c.orig	2007-05-13 10:03:37.000000000 -0600
+++ libelf/gelf_getsym.c	2007-05-13 09:57:32.000000000 -0600
@@ -127,7 +127,8 @@
 	  goto out;
 	}
 
-      *dst = ((GElf_Sym *) data->d_buf)[ndx];
+      memcpy(dst, &((GElf_Sym *) data->d_buf)[ndx], sizeof(GElf_Sym));
+      //*dst = ((GElf_Sym *) data->d_buf)[ndx];
     }
 
   result = dst;
--- libelf/elf_begin.c.orig	2007-05-13 10:03:13.000000000 -0600
+++ libelf/elf_begin.c	2007-05-13 10:00:31.000000000 -0600
@@ -111,9 +111,11 @@
   bool is32 = e_ident[EI_CLASS] == ELFCLASS32;
 
   /* Make the ELF header available.  */
+#if 0
   if (e_ident[EI_DATA] == MY_ELFDATA)
     ehdr.p = e_ident;
   else
+#endif
     {
       /* We already read the ELF header.  We have to copy the header
 	 since we possibly modify the data here and the caller
@@ -130,8 +132,11 @@
 	  else
 	    memcpy (&ehdr_mem, e_ident, sizeof (Elf32_Ehdr));
 
-	  CONVERT (ehdr_mem.e32.e_shnum);
-	  CONVERT (ehdr_mem.e32.e_shoff);
+	  if (e_ident[EI_DATA] != MY_ELFDATA)
+	  {
+	    CONVERT (ehdr_mem.e32.e_shnum);
+	    CONVERT (ehdr_mem.e32.e_shoff);
+	  }
 	}
       else
 	{
@@ -143,8 +148,11 @@
 	  else
 	    memcpy (&ehdr_mem, e_ident, sizeof (Elf64_Ehdr));
 
-	  CONVERT (ehdr_mem.e64.e_shnum);
-	  CONVERT (ehdr_mem.e64.e_shoff);
+	  if (e_ident[EI_DATA] != MY_ELFDATA)
+	  {
+	    CONVERT (ehdr_mem.e64.e_shnum);
+	    CONVERT (ehdr_mem.e64.e_shoff);
+	  }
 	}
     }
 
