diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-03-22 19:01:16 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-03-22 19:01:16 +0000 |
commit | 82bb8a2bf821909496cfe23fd0530500533df6b1 (patch) | |
tree | fe9bce00ab435607b7b6df727477bf724d023ded | |
parent | 851895ab80341f80398b93c9ad4aa20fcf463730 (diff) | |
download | busybox-w32-82bb8a2bf821909496cfe23fd0530500533df6b1.tar.gz busybox-w32-82bb8a2bf821909496cfe23fd0530500533df6b1.tar.bz2 busybox-w32-82bb8a2bf821909496cfe23fd0530500533df6b1.zip |
Patch from Dirk Behme <dirk.behme@de.bosch.com> to
add EM_MIPS_RS3_LE for mips
-Erik
-rw-r--r-- | insmod.c | 15 | ||||
-rw-r--r-- | modutils/insmod.c | 15 |
2 files changed, 26 insertions, 4 deletions
@@ -119,7 +119,7 @@ | |||
119 | #ifndef MODUTILS_MODULE_H | 119 | #ifndef MODUTILS_MODULE_H |
120 | static const int MODUTILS_MODULE_H = 1; | 120 | static const int MODUTILS_MODULE_H = 1; |
121 | 121 | ||
122 | #ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" | 122 | #ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" |
123 | 123 | ||
124 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 124 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
125 | We do not use the kernel headers directly because we do not wish | 125 | We do not use the kernel headers directly because we do not wish |
@@ -325,7 +325,7 @@ int delete_module(const char *); | |||
325 | #ifndef MODUTILS_OBJ_H | 325 | #ifndef MODUTILS_OBJ_H |
326 | static const int MODUTILS_OBJ_H = 1; | 326 | static const int MODUTILS_OBJ_H = 1; |
327 | 327 | ||
328 | #ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" | 328 | #ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" |
329 | 329 | ||
330 | /* The relocatable object is manipulated using elfin types. */ | 330 | /* The relocatable object is manipulated using elfin types. */ |
331 | 331 | ||
@@ -373,6 +373,15 @@ static const int MODUTILS_OBJ_H = 1; | |||
373 | 373 | ||
374 | #elif defined(__mips__) | 374 | #elif defined(__mips__) |
375 | 375 | ||
376 | /* Account for ELF spec changes. */ | ||
377 | #ifndef EM_MIPS_RS3_LE | ||
378 | #ifdef EM_MIPS_RS4_BE | ||
379 | #define EM_MIPS_RS3_LE EM_MIPS_RS4_BE | ||
380 | #else | ||
381 | #define EM_MIPS_RS3_LE 10 | ||
382 | #endif | ||
383 | #endif /* !EM_MIPS_RS3_LE */ | ||
384 | |||
376 | #define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE) | 385 | #define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE) |
377 | #define SHT_RELM SHT_REL | 386 | #define SHT_RELM SHT_REL |
378 | #define Elf32_RelM Elf32_Rel | 387 | #define Elf32_RelM Elf32_Rel |
@@ -793,7 +802,9 @@ arch_apply_relocation(struct obj_file *f, | |||
793 | ElfW(RelM) *rel, ElfW(Addr) v) | 802 | ElfW(RelM) *rel, ElfW(Addr) v) |
794 | { | 803 | { |
795 | struct arch_file *ifile = (struct arch_file *) f; | 804 | struct arch_file *ifile = (struct arch_file *) f; |
805 | #if !(defined(__mips__)) | ||
796 | struct arch_symbol *isym = (struct arch_symbol *) sym; | 806 | struct arch_symbol *isym = (struct arch_symbol *) sym; |
807 | #endif | ||
797 | 808 | ||
798 | ElfW(Addr) *loc = (ElfW(Addr) *) (targsec->contents + rel->r_offset); | 809 | ElfW(Addr) *loc = (ElfW(Addr) *) (targsec->contents + rel->r_offset); |
799 | ElfW(Addr) dot = targsec->header.sh_addr + rel->r_offset; | 810 | ElfW(Addr) dot = targsec->header.sh_addr + rel->r_offset; |
diff --git a/modutils/insmod.c b/modutils/insmod.c index fe4e06a6c..0a7cb1e4a 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -119,7 +119,7 @@ | |||
119 | #ifndef MODUTILS_MODULE_H | 119 | #ifndef MODUTILS_MODULE_H |
120 | static const int MODUTILS_MODULE_H = 1; | 120 | static const int MODUTILS_MODULE_H = 1; |
121 | 121 | ||
122 | #ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" | 122 | #ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" |
123 | 123 | ||
124 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 124 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
125 | We do not use the kernel headers directly because we do not wish | 125 | We do not use the kernel headers directly because we do not wish |
@@ -325,7 +325,7 @@ int delete_module(const char *); | |||
325 | #ifndef MODUTILS_OBJ_H | 325 | #ifndef MODUTILS_OBJ_H |
326 | static const int MODUTILS_OBJ_H = 1; | 326 | static const int MODUTILS_OBJ_H = 1; |
327 | 327 | ||
328 | #ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" | 328 | #ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" |
329 | 329 | ||
330 | /* The relocatable object is manipulated using elfin types. */ | 330 | /* The relocatable object is manipulated using elfin types. */ |
331 | 331 | ||
@@ -373,6 +373,15 @@ static const int MODUTILS_OBJ_H = 1; | |||
373 | 373 | ||
374 | #elif defined(__mips__) | 374 | #elif defined(__mips__) |
375 | 375 | ||
376 | /* Account for ELF spec changes. */ | ||
377 | #ifndef EM_MIPS_RS3_LE | ||
378 | #ifdef EM_MIPS_RS4_BE | ||
379 | #define EM_MIPS_RS3_LE EM_MIPS_RS4_BE | ||
380 | #else | ||
381 | #define EM_MIPS_RS3_LE 10 | ||
382 | #endif | ||
383 | #endif /* !EM_MIPS_RS3_LE */ | ||
384 | |||
376 | #define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE) | 385 | #define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE) |
377 | #define SHT_RELM SHT_REL | 386 | #define SHT_RELM SHT_REL |
378 | #define Elf32_RelM Elf32_Rel | 387 | #define Elf32_RelM Elf32_Rel |
@@ -793,7 +802,9 @@ arch_apply_relocation(struct obj_file *f, | |||
793 | ElfW(RelM) *rel, ElfW(Addr) v) | 802 | ElfW(RelM) *rel, ElfW(Addr) v) |
794 | { | 803 | { |
795 | struct arch_file *ifile = (struct arch_file *) f; | 804 | struct arch_file *ifile = (struct arch_file *) f; |
805 | #if !(defined(__mips__)) | ||
796 | struct arch_symbol *isym = (struct arch_symbol *) sym; | 806 | struct arch_symbol *isym = (struct arch_symbol *) sym; |
807 | #endif | ||
797 | 808 | ||
798 | ElfW(Addr) *loc = (ElfW(Addr) *) (targsec->contents + rel->r_offset); | 809 | ElfW(Addr) *loc = (ElfW(Addr) *) (targsec->contents + rel->r_offset); |
799 | ElfW(Addr) dot = targsec->header.sh_addr + rel->r_offset; | 810 | ElfW(Addr) dot = targsec->header.sh_addr + rel->r_offset; |