Index: elfutils-0.122/libelf/common.h
===================================================================
--- elfutils-0.122.orig/libelf/common.h	2006-07-30 23:28:56.000000000 +0200
+++ elfutils-0.122/libelf/common.h	2006-07-30 23:32:38.000000000 +0200
@@ -153,21 +153,21 @@
    has to use itself.  */
 #define CONVERT(Var) \
   (Var) = (sizeof (Var) == 1						      \
-	   ? (unsigned char) (Var)					      \
+	   ? (typeof (Var)) (Var)					      \
 	   : (sizeof (Var) == 2						      \
-	      ? (unsigned short int) bswap_16 (Var)			      \
+	      ? (typeof (Var)) bswap_16 (Var)		        	      \
 	      : (sizeof (Var) == 4					      \
-		 ? bswap_32 (Var)					      \
-		 : bswap_64 (Var))))
+		 ? (typeof (Var)) bswap_32 (Var)			      \
+		 : (typeof (Var)) bswap_64 (Var))))
 
 #define CONVERT_TO(Dst, Var) \
   (Dst) = (sizeof (Var) == 1						      \
-	   ? (unsigned char) (Var)					      \
+	   ? (typeof (Dst)) (Var)					      \
 	   : (sizeof (Var) == 2						      \
-	      ? (unsigned short int) bswap_16 (Var)			      \
+	      ? (typeof (Dst)) bswap_16 (Var)	        		      \
 	      : (sizeof (Var) == 4					      \
-		 ? bswap_32 (Var)					      \
-		 : bswap_64 (Var))))
+		 ? (typeof (Dst)) bswap_32 (Var)			      \
+		 : (typeof (Dst)) bswap_64 (Var))))
 
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
Index: elfutils-0.122/libelf/gnuhash_xlate.h
===================================================================
--- elfutils-0.122.orig/libelf/gnuhash_xlate.h	2006-07-30 23:28:56.000000000 +0200
+++ elfutils-0.122/libelf/gnuhash_xlate.h	2006-07-30 23:33:44.000000000 +0200
@@ -89,7 +89,8 @@
   dest32 = (Elf32_Word *) &dest64[bitmask_words];
   while (len > 4)
     {
-      *dest32++ = bswap_32 (*src32++);
+      Elf32_Word tmp = *src32++;
+      *dest32++ = bswap_32 (tmp);
       len -= 4;
     }
 }

