[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] [patch] move EM_XILINX_MICROBLAZE, use it in modutils/insmod.c



Hello,

In the process of building busybox-1.10.1 for microblaze-linux-mmu I had to
make a change to the Linux kernel (patch attached):

        Moved EM_XILINX_MICROBLAZE to the central location where every
        other kind of ELF_<PLATFORM> is defined. This seems more
        consistent with other platforms and also allows busybox
        modutils/insmod.c to compile with just a dependency on
        linux/elf-em.h without forcing installation of
        asm-microblaze/elf.h into headers_install.

I also needed to include linux/elf-em.h in
busybox-1.10.1/modutils/insmod.c (also attached).
I placed the include conservatively, but it probably belongs at the
top along of the file.

Do these changes look correct?

Thanks
Greg
-- 
nest.cx is Gmail hosted, use PGP for anything private. Key:
http://tinyurl.com/ho8qg
Fingerprint: 5E2B 2D0E 1E03 2046 BEC3 4D50 0B15 42BD 8DF5 A1B0
	Moved EM_XILINX_MICROBLAZE to the central location where every
	other kind of ELF_<PLATFORM> is defined. This seems more
	consistent with other platforms and also allows busybox
	modutils/insmod.c to compile with just a dependency on
	linux/elf-em.h without forcing installation of
	asm-microblaze/elf.h into headers_install.
	
--- linux_2_6_25/include/asm-microblaze/elf.h#2	2008-05-16 15:47:35.000000000 -0700
+++ linux_2_6_25/include/asm-microblaze/elf.h#3	2008-05-16 16:51:10.000000000 -0700
@@ -15,13 +15,6 @@
 
 #include <linux/autoconf.h>
 
-/* 
- * Note there is no "official" ELF designation for Microblaze.
- * I've snaffled the value from the microblaze binutils source code
- * /binutils/microblaze/include/elf/microblaze.h
- */
-
-#define EM_XILINX_MICROBLAZE	0xbaab
 #define ELF_ARCH		EM_XILINX_MICROBLAZE
 
 /*
--- linux_2_6_25/include/linux/elf-em.h#1	2008-05-16 15:47:35.000000000 -0700
+++ linux_2_6_25/include/linux/elf-em.h#2	2008-05-16 16:51:10.000000000 -0700
@@ -48,6 +48,14 @@
 #define EM_CYGNUS_M32R	0x9041
 /* This is the old interim value for S/390 architecture */
 #define EM_S390_OLD	0xA390
+
+/* 
+ * Note there is no "official" ELF designation for Microblaze.
+ * I've snaffled the value from the microblaze binutils source code
+ * /binutils/microblaze/include/elf/microblaze.h
+ */
+#define EM_XILINX_MICROBLAZE	0xbaab
+
 /* Also Panasonic/MEI MN10300, AM33 */
 #define EM_CYGNUS_MN10300 0xbeef
 
EM_XILINX_MICROBLAZE should be declared in linux/elf-em.h.
Get it from there.
--- modutils/insmod.c~	2008-04-18 20:50:30.000000000 -0700
+++ modutils/insmod.c	2008-05-15 17:08:42.000000000 -0700
@@ -184,6 +184,7 @@
 /* Microblaze */
 #if defined(__microblaze__)
 #define USE_SINGLE
+#include <linux/elf-em.h>
 #define MATCH_MACHINE(x) (x == EM_XILINX_MICROBLAZE)
 #define SHT_RELM	SHT_RELA
 #define Elf32_RelM	Elf32_Rela