]> granicus.if.org Git - file/commitdiff
make `swap' detection work properly on 64 bit machines; from mycroft
authorChristos Zoulas <christos@zoulas.com>
Fri, 28 Jul 2000 23:03:08 +0000 (23:03 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 28 Jul 2000 23:03:08 +0000 (23:03 +0000)
src/readelf.c

index bff338c95875afecbda35cbfc7b8da0613b0f9bd..61c9a8877fb5bf523a82af4dcc9b6ea9d45be6ab 100644 (file)
@@ -14,7 +14,7 @@
 #include "readelf.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$Id: readelf.c,v 1.12 2000/04/11 02:32:35 christos Exp $")
+FILE_RCSID("@(#)$Id: readelf.c,v 1.13 2000/07/28 23:03:08 christos Exp $")
 #endif
 
 #ifdef ELFCORE
@@ -377,7 +377,7 @@ tryelf(fd, buf, nbytes)
 
                u.l = 1;
                (void) memcpy(&elfhdr, buf, sizeof elfhdr);
-               swap = (u.c[sizeof(long) - 1] + 1) != elfhdr.e_ident[5];
+               swap = (u.c[sizeof(int32) - 1] + 1) != elfhdr.e_ident[5];
 
                if (getu16(swap, elfhdr.e_type) == ET_CORE) 
 #ifdef ELFCORE
@@ -414,7 +414,7 @@ tryelf(fd, buf, nbytes)
 
                u.l = 1;
                (void) memcpy(&elfhdr, buf, sizeof elfhdr);
-               swap = (u.c[sizeof(long) - 1] + 1) != elfhdr.e_ident[5];
+               swap = (u.c[sizeof(int32) - 1] + 1) != elfhdr.e_ident[5];
 
                if (getu16(swap, elfhdr.e_type) == ET_CORE) 
 #ifdef ELFCORE