Add (untested) support for cris, based on the (old) busybox insmod

that axis distributes.
This commit is contained in:
Manuel Novoa III 2003-12-04 15:02:57 +00:00
parent c83e3a6406
commit 22e1ca382b

View File

@ -219,6 +219,19 @@
#define SYMBOL_PREFIX "_" #define SYMBOL_PREFIX "_"
#endif #endif
#if defined(__cris__)
#ifndef EM_CRIS
#define EM_CRIS 76
#define R_CRIS_NONE 0
#define R_CRIS_32 3
#endif
#define MATCH_MACHINE(x) (x == EM_CRIS)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#endif
#ifndef SHT_RELM #ifndef SHT_RELM
#error Sorry, but insmod.c does not yet support this architecture... #error Sorry, but insmod.c does not yet support this architecture...
#endif #endif
@ -253,7 +266,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1; static const int MODUTILS_MODULE_H = 1;
#ident "$Id: insmod.c,v 1.105 2003/10/21 06:45:29 andersen Exp $" #ident "$Id: insmod.c,v 1.106 2003/12/04 15:02:57 mjn3 Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish We do not use the kernel headers directly because we do not wish
@ -474,7 +487,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1; static const int MODUTILS_OBJ_H = 1;
#ident "$Id: insmod.c,v 1.105 2003/10/21 06:45:29 andersen Exp $" #ident "$Id: insmod.c,v 1.106 2003/12/04 15:02:57 mjn3 Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -1280,6 +1293,18 @@ arch_apply_relocation(struct obj_file *f,
goto bb_use_plt; goto bb_use_plt;
#endif #endif
#if defined (__cris__)
case R_CRIS_NONE:
break;
case R_CRIS_32:
/* CRIS keeps the relocation value in the r_addend field and
* should not use whats in *loc at all
*/
*loc = v;
break;
#endif
#if defined(CONFIG_USE_PLT_ENTRIES) #if defined(CONFIG_USE_PLT_ENTRIES)
bb_use_plt: bb_use_plt: