[BusyBox-cvs] CVS update of busybox (README modutils/insmod.c)
Erik Andersen
andersen at codepoet.org
Thu Sep 2 23:03:26 UTC 2004
Date: Thursday, September 2, 2004 @ 17:03:26
Author: andersen
Path: /var/cvs/busybox
Modified: README (1.35 -> 1.36) modutils/insmod.c (1.124 -> 1.125)
Based on patches from Mike Frysinger, add insmod support for
sparc and ia64 (itanium).
Also, reorganize the insmod architecture support code to be
alphasorted and less messy.
Update the readme to list current insmod arch support.
Index: busybox/README
diff -u busybox/README:1.35 busybox/README:1.36
--- busybox/README:1.35 Mon Apr 12 09:05:10 2004
+++ busybox/README Thu Sep 2 17:03:24 2004
@@ -33,23 +33,24 @@
BusyBox in general will build on any architecture supported by gcc. It has
a few specialized features added for __sparc__ and __alpha__. insmod
- functionality is currently limited to x86, ARM, SH3/4, powerpc, m68k,
- MIPS, cris, and v850e.
+ functionality is currently limited to ARM, CRIS, H8/300, x86, ia64,
+ x86_64, m68k, MIPS, PowerPC, S390, SH3/4/5, Sparc, v850e, and x86_64
+ for 2.4.x kernels. For 2.6.x kernels
Supported C Libraries:
- glibc-2.0.x, glibc-2.1.x, glibc-2.2.x, glibc-2.3.x, uClibc. People
- are looking at newlib and diet-libc, but consider them unsupported,
- untested, or worse. Linux-libc5 is no longer supported -- you
- should probably use uClibc instead if you want a small C library.
+ uClibc and glibc are supported. People have been looking at newlib and
+ diet-libc, but they are currently considered unsupported, untested, or
+ worse. Linux-libc5 is no longer supported -- you should probably use uClibc
+ instead if you want a small C library.
Supported kernels:
Full functionality requires Linux 2.2.x or better. A large fraction of the
code should run on just about anything. While the current code is fairly
Linux specific, it should be fairly easy to port the majority of the code
- to, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you are into
- that sort of thing).
+ to support, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you
+ are into that sort of thing).
----------------
Index: busybox/modutils/insmod.c
diff -u busybox/modutils/insmod.c:1.124 busybox/modutils/insmod.c:1.125
--- busybox/modutils/insmod.c:1.124 Fri Aug 27 18:43:06 2004
+++ busybox/modutils/insmod.c Thu Sep 2 17:03:25 2004
@@ -2,8 +2,8 @@
/*
* Mini insmod implementation for busybox
*
- * This version of insmod supports x86, x86_64, ARM, SH3/4/5, powerpc, m68k,
- * MIPS, v850e, and H8/300.
+ * This version of insmod supports ARM, CRIS, H8/300, x86, ia64, x86_64,
+ * m68k, MIPS, PowerPC, S390, SH3/4/5, Sparc, v850e, and x86_64.
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen at codepoet.org>
* and Ron Alder <alder at lineo.com>
@@ -109,67 +109,82 @@
#endif
+/* ARM support */
#if defined(__arm__)
-#define CONFIG_USE_PLT_ENTRIES
-#define CONFIG_PLT_ENTRY_SIZE 8
-#define CONFIG_USE_GOT_ENTRIES
-#define CONFIG_GOT_ENTRY_SIZE 8
-#define CONFIG_USE_SINGLE
-
#define MATCH_MACHINE(x) (x == EM_ARM)
#define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel
#define ELFCLASSM ELFCLASS32
-#endif
-
-#if defined(__s390__)
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
+#endif
-#define MATCH_MACHINE(x) (x == EM_S390)
+/* CRIS */
+#if defined(__cris__)
+#define MATCH_MACHINE(x) (x == EM_CRIS)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
+#ifndef EM_CRIS
+#define EM_CRIS 76
+#define R_CRIS_NONE 0
+#define R_CRIS_32 3
+#endif
#endif
-#if defined(__i386__)
-#define CONFIG_USE_GOT_ENTRIES
-#define CONFIG_GOT_ENTRY_SIZE 4
+/* H8/300 */
+#if defined(__H8300H__) || defined(__H8300S__)
+#define MATCH_MACHINE(x) (x == EM_H8_300)
+#define SHT_RELM SHT_RELA
+#define Elf32_RelM Elf32_Rela
+#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_SINGLE
+#define SYMBOL_PREFIX "_"
+#endif
+/* x86 */
+#if defined(__i386__)
#ifndef EM_486
#define MATCH_MACHINE(x) (x == EM_386)
#else
#define MATCH_MACHINE(x) (x == EM_386 || x == EM_486)
#endif
-
#define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel
#define ELFCLASSM ELFCLASS32
+#define CONFIG_USE_GOT_ENTRIES
+#define CONFIG_GOT_ENTRY_SIZE 4
+#define CONFIG_USE_SINGLE
#endif
-#if defined(__x86_64__)
-#define MATCH_MACHINE(x) (x == EM_X86_64)
-#define SHT_RELM SHT_REL
-#define Elf64_RelM Elf64_Rel
-#define ELFCLASSM ELFCLASS64
+/* IA64, aka Itanium */
+#if defined(__ia64__)
+#define MATCH_MACHINE(x) (x == EM_IA_64)
+#define SHT_RELM SHT_RELA
+#define Elf64_RelM Elf64_Rela
+#define ELFCLASSM ELFCLASS64
#endif
+/* m68k */
#if defined(__mc68000__)
-#define CONFIG_USE_GOT_ENTRIES
-#define CONFIG_GOT_ENTRY_SIZE 4
-#define CONFIG_USE_SINGLE
-
#define MATCH_MACHINE(x) (x == EM_68K)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
+#define CONFIG_USE_GOT_ENTRIES
+#define CONFIG_GOT_ENTRY_SIZE 4
+#define CONFIG_USE_SINGLE
#endif
+/* MIPS */
#if defined(__mips__)
+#define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE)
+#define SHT_RELM SHT_REL
+#define Elf32_RelM Elf32_Rel
+#define ELFCLASSM ELFCLASS32
/* Account for ELF spec changes. */
#ifndef EM_MIPS_RS3_LE
#ifdef EM_MIPS_RS4_BE
@@ -178,92 +193,85 @@
#define EM_MIPS_RS3_LE 10
#endif
#endif /* !EM_MIPS_RS3_LE */
-
-#define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE)
-#define SHT_RELM SHT_REL
-#define Elf32_RelM Elf32_Rel
-#define ELFCLASSM ELFCLASS32
#define ARCHDATAM "__dbe_table"
#endif
+/* PowerPC */
#if defined(__powerpc__)
+#define MATCH_MACHINE(x) (x == EM_PPC)
+#define SHT_RELM SHT_RELA
+#define Elf32_RelM Elf32_Rela
+#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 16
#define CONFIG_USE_PLT_LIST
#define CONFIG_LIST_ARCHTYPE ElfW(Addr)
#define CONFIG_USE_LIST
+#define ARCHDATAM "__ftr_fixup"
+#endif
-#define MATCH_MACHINE(x) (x == EM_PPC)
+/* S390 */
+#if defined(__s390__)
+#define MATCH_MACHINE(x) (x == EM_S390)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
-#define ARCHDATAM "__ftr_fixup"
-#endif
-
-#if defined(__sh__)
+#define CONFIG_USE_PLT_ENTRIES
+#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_GOT_ENTRIES
-#define CONFIG_GOT_ENTRY_SIZE 4
+#define CONFIG_GOT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
+#endif
+/* SuperH */
+#if defined(__sh__)
#define MATCH_MACHINE(x) (x == EM_SH)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
-
+#define CONFIG_USE_GOT_ENTRIES
+#define CONFIG_GOT_ENTRY_SIZE 4
+#define CONFIG_USE_SINGLE
/* the SH changes have only been tested in =little endian= mode */
/* I'm not sure about big endian, so let's warn: */
-
#if defined(__sh__) && defined(__BIG_ENDIAN__)
#error insmod.c may require changes for use on big endian SH
#endif
-
-/* it may or may not work on the SH1/SH2... So let's error on those
- also */
-#if ((!(defined(__SH3__) || defined(__SH4__) || defined(__SH5__)))) && \
- (defined(__sh__))
+/* it may or may not work on the SH1/SH2... Error on those also */
+#if ((!(defined(__SH3__) || defined(__SH4__) || defined(__SH5__)))) && (defined(__sh__))
#error insmod.c may require changes for SH1 or SH2 use
#endif
#endif
+/* Sparc */
+#if defined(__sparc__)
+#define MATCH_MACHINE(x) (x == EM_SPARC)
+#define SHT_RELM SHT_RELA
+#define Elf32_RelM Elf32_Rela
+#define ELFCLASSM ELFCLASS32
+#endif
+
+/* v850e */
#if defined (__v850e__)
+#define MATCH_MACHINE(x) ((x) == EM_V850 || (x) == EM_CYGNUS_V850)
+#define SHT_RELM SHT_RELA
+#define Elf32_RelM Elf32_Rela
+#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
-
#ifndef EM_CYGNUS_V850 /* grumble */
#define EM_CYGNUS_V850 0x9080
#endif
-
-#define MATCH_MACHINE(x) ((x) == EM_V850 || (x) == EM_CYGNUS_V850)
-#define SHT_RELM SHT_RELA
-#define Elf32_RelM Elf32_Rela
-#define ELFCLASSM ELFCLASS32
-
#define SYMBOL_PREFIX "_"
#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
-
-#if defined(__H8300H__) || defined(__H8300S__)
-#define CONFIG_USE_SINGLE
-
-#define MATCH_MACHINE(x) (x == EM_H8_300)
-#define SHT_RELM SHT_RELA
-#define Elf32_RelM Elf32_Rela
-
-#define ELFCLASSM ELFCLASS32
-#define SYMBOL_PREFIX "_"
+/* X86_64 */
+#if defined(__x86_64__)
+#define MATCH_MACHINE(x) (x == EM_X86_64)
+#define SHT_RELM SHT_REL
+#define Elf64_RelM Elf64_Rel
+#define ELFCLASSM ELFCLASS64
#endif
#ifndef SHT_RELM
More information about the busybox-cvs
mailing list