diff options
| author | Manuel Novoa III <mjn3@codepoet.org> | 2003-12-04 15:02:57 +0000 |
|---|---|---|
| committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-12-04 15:02:57 +0000 |
| commit | 22e1ca382be38c2f4566925de25f3c749dd44232 (patch) | |
| tree | 58a22836097dce8096099a0fcf11e43e160abf12 /modutils | |
| parent | c83e3a6406b4e3cc2d9499c1f21a5b369b972867 (diff) | |
| download | busybox-w32-22e1ca382be38c2f4566925de25f3c749dd44232.tar.gz busybox-w32-22e1ca382be38c2f4566925de25f3c749dd44232.tar.bz2 busybox-w32-22e1ca382be38c2f4566925de25f3c749dd44232.zip | |
Add (untested) support for cris, based on the (old) busybox insmod
that axis distributes.
Diffstat (limited to 'modutils')
| -rw-r--r-- | modutils/insmod.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c index a30aed9e7..e2ca64169 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
| @@ -219,6 +219,19 @@ | |||
| 219 | #define SYMBOL_PREFIX "_" | 219 | #define SYMBOL_PREFIX "_" |
| 220 | #endif | 220 | #endif |
| 221 | 221 | ||
| 222 | #if defined(__cris__) | ||
| 223 | #ifndef EM_CRIS | ||
| 224 | #define EM_CRIS 76 | ||
| 225 | #define R_CRIS_NONE 0 | ||
| 226 | #define R_CRIS_32 3 | ||
| 227 | #endif | ||
| 228 | |||
| 229 | #define MATCH_MACHINE(x) (x == EM_CRIS) | ||
| 230 | #define SHT_RELM SHT_RELA | ||
| 231 | #define Elf32_RelM Elf32_Rela | ||
| 232 | #define ELFCLASSM ELFCLASS32 | ||
| 233 | #endif | ||
| 234 | |||
| 222 | #ifndef SHT_RELM | 235 | #ifndef SHT_RELM |
| 223 | #error Sorry, but insmod.c does not yet support this architecture... | 236 | #error Sorry, but insmod.c does not yet support this architecture... |
| 224 | #endif | 237 | #endif |
| @@ -253,7 +266,7 @@ | |||
| 253 | #ifndef MODUTILS_MODULE_H | 266 | #ifndef MODUTILS_MODULE_H |
| 254 | static const int MODUTILS_MODULE_H = 1; | 267 | static const int MODUTILS_MODULE_H = 1; |
| 255 | 268 | ||
| 256 | #ident "$Id: insmod.c,v 1.105 2003/10/21 06:45:29 andersen Exp $" | 269 | #ident "$Id: insmod.c,v 1.106 2003/12/04 15:02:57 mjn3 Exp $" |
| 257 | 270 | ||
| 258 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 271 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
| 259 | We do not use the kernel headers directly because we do not wish | 272 | We do not use the kernel headers directly because we do not wish |
| @@ -474,7 +487,7 @@ int delete_module(const char *); | |||
| 474 | #ifndef MODUTILS_OBJ_H | 487 | #ifndef MODUTILS_OBJ_H |
| 475 | static const int MODUTILS_OBJ_H = 1; | 488 | static const int MODUTILS_OBJ_H = 1; |
| 476 | 489 | ||
| 477 | #ident "$Id: insmod.c,v 1.105 2003/10/21 06:45:29 andersen Exp $" | 490 | #ident "$Id: insmod.c,v 1.106 2003/12/04 15:02:57 mjn3 Exp $" |
| 478 | 491 | ||
| 479 | /* The relocatable object is manipulated using elfin types. */ | 492 | /* The relocatable object is manipulated using elfin types. */ |
| 480 | 493 | ||
| @@ -1280,6 +1293,18 @@ arch_apply_relocation(struct obj_file *f, | |||
| 1280 | goto bb_use_plt; | 1293 | goto bb_use_plt; |
| 1281 | #endif | 1294 | #endif |
| 1282 | 1295 | ||
| 1296 | #if defined (__cris__) | ||
| 1297 | case R_CRIS_NONE: | ||
| 1298 | break; | ||
| 1299 | |||
| 1300 | case R_CRIS_32: | ||
| 1301 | /* CRIS keeps the relocation value in the r_addend field and | ||
| 1302 | * should not use whats in *loc at all | ||
| 1303 | */ | ||
| 1304 | *loc = v; | ||
| 1305 | break; | ||
| 1306 | #endif | ||
| 1307 | |||
| 1283 | #if defined(CONFIG_USE_PLT_ENTRIES) | 1308 | #if defined(CONFIG_USE_PLT_ENTRIES) |
| 1284 | 1309 | ||
| 1285 | bb_use_plt: | 1310 | bb_use_plt: |
