aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-03-25 02:49:28 +0000
committerRob Landley <rob@landley.net>2006-03-25 02:49:28 +0000
commit0bafd47e840bcf887df7d3a634748f3254b01408 (patch)
treea91b1a556912e3fb3b61512436eb7479f40a3363
parent771b1864064e211bd2548f2fe06b17af27688377 (diff)
downloadbusybox-w32-0bafd47e840bcf887df7d3a634748f3254b01408.tar.gz
busybox-w32-0bafd47e840bcf887df7d3a634748f3254b01408.tar.bz2
busybox-w32-0bafd47e840bcf887df7d3a634748f3254b01408.zip
Stephane Billiart found an endianness bug in insmod.
-rw-r--r--modutils/insmod.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 26dd9783b..efa0499e4 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -516,12 +516,6 @@ int delete_module(const char *);
516#include <elf.h> 516#include <elf.h>
517#include <endian.h> 517#include <endian.h>
518 518
519#if BB_LITTLE_ENDIAN
520# define ELFDATAM ELFDATA2LSB
521#else
522# define ELFDATAM ELFDATA2MSB
523#endif
524
525#ifndef ElfW 519#ifndef ElfW
526# if ELFCLASSM == ELFCLASS32 520# if ELFCLASSM == ELFCLASS32
527# define ElfW(x) Elf32_ ## x 521# define ElfW(x) Elf32_ ## x
@@ -3331,7 +3325,8 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
3331 return NULL; 3325 return NULL;
3332 } 3326 }
3333 if (f->header.e_ident[EI_CLASS] != ELFCLASSM 3327 if (f->header.e_ident[EI_CLASS] != ELFCLASSM
3334 || f->header.e_ident[EI_DATA] != ELFDATAM 3328 || f->header.e_ident[EI_DATA] != (BB_BIG_ENDIAN
3329 ? ELFDATA2MSB : ELFDATA2LSB)
3335 || f->header.e_ident[EI_VERSION] != EV_CURRENT 3330 || f->header.e_ident[EI_VERSION] != EV_CURRENT
3336 || !MATCH_MACHINE(f->header.e_machine)) { 3331 || !MATCH_MACHINE(f->header.e_machine)) {
3337 bb_error_msg("ELF file not for this architecture"); 3332 bb_error_msg("ELF file not for this architecture");