diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-08-22 05:26:08 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-08-22 05:26:08 +0000 |
commit | ac5dbd193b7d4935d4ad54bc9a7ad6f10b34efa7 (patch) | |
tree | ad36cdd5ce38533db4d66c70f52de97fe43bf1bd | |
parent | 59443965ad359f3c72e2ea3a15c77140d938d930 (diff) | |
download | busybox-w32-ac5dbd193b7d4935d4ad54bc9a7ad6f10b34efa7.tar.gz busybox-w32-ac5dbd193b7d4935d4ad54bc9a7ad6f10b34efa7.tar.bz2 busybox-w32-ac5dbd193b7d4935d4ad54bc9a7ad6f10b34efa7.zip |
Fix an _old_ interface problem with a never-used feature.
-rw-r--r-- | insmod.c | 13 | ||||
-rw-r--r-- | modutils/insmod.c | 13 |
2 files changed, 10 insertions, 16 deletions
@@ -133,7 +133,7 @@ | |||
133 | #ifndef MODUTILS_MODULE_H | 133 | #ifndef MODUTILS_MODULE_H |
134 | static const int MODUTILS_MODULE_H = 1; | 134 | static const int MODUTILS_MODULE_H = 1; |
135 | 135 | ||
136 | #ident "$Id: insmod.c,v 1.71 2001/08/06 14:18:08 kraai Exp $" | 136 | #ident "$Id: insmod.c,v 1.72 2001/08/22 05:26:08 andersen Exp $" |
137 | 137 | ||
138 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 138 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
139 | We do not use the kernel headers directly because we do not wish | 139 | We do not use the kernel headers directly because we do not wish |
@@ -350,7 +350,7 @@ int delete_module(const char *); | |||
350 | #ifndef MODUTILS_OBJ_H | 350 | #ifndef MODUTILS_OBJ_H |
351 | static const int MODUTILS_OBJ_H = 1; | 351 | static const int MODUTILS_OBJ_H = 1; |
352 | 352 | ||
353 | #ident "$Id: insmod.c,v 1.71 2001/08/06 14:18:08 kraai Exp $" | 353 | #ident "$Id: insmod.c,v 1.72 2001/08/22 05:26:08 andersen Exp $" |
354 | 354 | ||
355 | /* The relocatable object is manipulated using elfin types. */ | 355 | /* The relocatable object is manipulated using elfin types. */ |
356 | 356 | ||
@@ -3160,9 +3160,8 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits) | |||
3160 | * kernel for the module | 3160 | * kernel for the module |
3161 | */ | 3161 | */ |
3162 | 3162 | ||
3163 | static int obj_load_progbits(FILE * fp, struct obj_file* f) | 3163 | static int obj_load_progbits(FILE * fp, struct obj_file* f, char* imagebase) |
3164 | { | 3164 | { |
3165 | char* imagebase = (char*) f->imagebase; | ||
3166 | ElfW(Addr) base = f->baseaddr; | 3165 | ElfW(Addr) base = f->baseaddr; |
3167 | struct obj_section* sec; | 3166 | struct obj_section* sec; |
3168 | 3167 | ||
@@ -3178,7 +3177,7 @@ static int obj_load_progbits(FILE * fp, struct obj_file* f) | |||
3178 | sec->contents = imagebase + (sec->header.sh_addr - base); | 3177 | sec->contents = imagebase + (sec->header.sh_addr - base); |
3179 | fseek(fp, sec->header.sh_offset, SEEK_SET); | 3178 | fseek(fp, sec->header.sh_offset, SEEK_SET); |
3180 | if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { | 3179 | if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { |
3181 | errorMsg("error reading ELF section data: %s\n", strerror(errno)); | 3180 | error_msg("error reading ELF section data: %s\n", strerror(errno)); |
3182 | return 0; | 3181 | return 0; |
3183 | } | 3182 | } |
3184 | 3183 | ||
@@ -3458,9 +3457,7 @@ extern int insmod_main( int argc, char **argv) | |||
3458 | * the PROGBITS section was not loaded by the obj_load | 3457 | * the PROGBITS section was not loaded by the obj_load |
3459 | * now we can load them directly into the kernel memory | 3458 | * now we can load them directly into the kernel memory |
3460 | */ | 3459 | */ |
3461 | // f->imagebase = (char*) m_addr; | 3460 | if (!obj_load_progbits(fp, f, (char*)m_addr)) { |
3462 | f->imagebase = (ElfW(Addr)) m_addr; | ||
3463 | if (!obj_load_progbits(fp, f)) { | ||
3464 | delete_module(m_name); | 3461 | delete_module(m_name); |
3465 | goto out; | 3462 | goto out; |
3466 | } | 3463 | } |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 50aa60eb6..34be00b32 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -133,7 +133,7 @@ | |||
133 | #ifndef MODUTILS_MODULE_H | 133 | #ifndef MODUTILS_MODULE_H |
134 | static const int MODUTILS_MODULE_H = 1; | 134 | static const int MODUTILS_MODULE_H = 1; |
135 | 135 | ||
136 | #ident "$Id: insmod.c,v 1.71 2001/08/06 14:18:08 kraai Exp $" | 136 | #ident "$Id: insmod.c,v 1.72 2001/08/22 05:26:08 andersen Exp $" |
137 | 137 | ||
138 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 138 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
139 | We do not use the kernel headers directly because we do not wish | 139 | We do not use the kernel headers directly because we do not wish |
@@ -350,7 +350,7 @@ int delete_module(const char *); | |||
350 | #ifndef MODUTILS_OBJ_H | 350 | #ifndef MODUTILS_OBJ_H |
351 | static const int MODUTILS_OBJ_H = 1; | 351 | static const int MODUTILS_OBJ_H = 1; |
352 | 352 | ||
353 | #ident "$Id: insmod.c,v 1.71 2001/08/06 14:18:08 kraai Exp $" | 353 | #ident "$Id: insmod.c,v 1.72 2001/08/22 05:26:08 andersen Exp $" |
354 | 354 | ||
355 | /* The relocatable object is manipulated using elfin types. */ | 355 | /* The relocatable object is manipulated using elfin types. */ |
356 | 356 | ||
@@ -3160,9 +3160,8 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits) | |||
3160 | * kernel for the module | 3160 | * kernel for the module |
3161 | */ | 3161 | */ |
3162 | 3162 | ||
3163 | static int obj_load_progbits(FILE * fp, struct obj_file* f) | 3163 | static int obj_load_progbits(FILE * fp, struct obj_file* f, char* imagebase) |
3164 | { | 3164 | { |
3165 | char* imagebase = (char*) f->imagebase; | ||
3166 | ElfW(Addr) base = f->baseaddr; | 3165 | ElfW(Addr) base = f->baseaddr; |
3167 | struct obj_section* sec; | 3166 | struct obj_section* sec; |
3168 | 3167 | ||
@@ -3178,7 +3177,7 @@ static int obj_load_progbits(FILE * fp, struct obj_file* f) | |||
3178 | sec->contents = imagebase + (sec->header.sh_addr - base); | 3177 | sec->contents = imagebase + (sec->header.sh_addr - base); |
3179 | fseek(fp, sec->header.sh_offset, SEEK_SET); | 3178 | fseek(fp, sec->header.sh_offset, SEEK_SET); |
3180 | if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { | 3179 | if (fread(sec->contents, sec->header.sh_size, 1, fp) != 1) { |
3181 | errorMsg("error reading ELF section data: %s\n", strerror(errno)); | 3180 | error_msg("error reading ELF section data: %s\n", strerror(errno)); |
3182 | return 0; | 3181 | return 0; |
3183 | } | 3182 | } |
3184 | 3183 | ||
@@ -3458,9 +3457,7 @@ extern int insmod_main( int argc, char **argv) | |||
3458 | * the PROGBITS section was not loaded by the obj_load | 3457 | * the PROGBITS section was not loaded by the obj_load |
3459 | * now we can load them directly into the kernel memory | 3458 | * now we can load them directly into the kernel memory |
3460 | */ | 3459 | */ |
3461 | // f->imagebase = (char*) m_addr; | 3460 | if (!obj_load_progbits(fp, f, (char*)m_addr)) { |
3462 | f->imagebase = (ElfW(Addr)) m_addr; | ||
3463 | if (!obj_load_progbits(fp, f)) { | ||
3464 | delete_module(m_name); | 3461 | delete_module(m_name); |
3465 | goto out; | 3462 | goto out; |
3466 | } | 3463 | } |