svn commit: trunk/busybox/modutils
landley at busybox.net
landley at busybox.net
Sat Mar 25 02:49:30 UTC 2006
Author: landley
Date: 2006-03-24 18:49:28 -0800 (Fri, 24 Mar 2006)
New Revision: 14653
Log:
Stephane Billiart found an endianness bug in insmod.
Modified:
trunk/busybox/modutils/insmod.c
Changeset:
Modified: trunk/busybox/modutils/insmod.c
===================================================================
--- trunk/busybox/modutils/insmod.c 2006-03-25 01:28:27 UTC (rev 14652)
+++ trunk/busybox/modutils/insmod.c 2006-03-25 02:49:28 UTC (rev 14653)
@@ -516,12 +516,6 @@
#include <elf.h>
#include <endian.h>
-#if BB_LITTLE_ENDIAN
-# define ELFDATAM ELFDATA2LSB
-#else
-# define ELFDATAM ELFDATA2MSB
-#endif
-
#ifndef ElfW
# if ELFCLASSM == ELFCLASS32
# define ElfW(x) Elf32_ ## x
@@ -3331,7 +3325,8 @@
return NULL;
}
if (f->header.e_ident[EI_CLASS] != ELFCLASSM
- || f->header.e_ident[EI_DATA] != ELFDATAM
+ || f->header.e_ident[EI_DATA] != (BB_BIG_ENDIAN
+ ? ELFDATA2MSB : ELFDATA2LSB)
|| f->header.e_ident[EI_VERSION] != EV_CURRENT
|| !MATCH_MACHINE(f->header.e_machine)) {
bb_error_msg("ELF file not for this architecture");
More information about the busybox-cvs
mailing list