]> git.proxmox.com Git - grub2.git/commitdiff
fake __gnu_local_gp
authorphcoder <phcoder@debian.bg45.phnet>
Sat, 10 Oct 2009 12:54:18 +0000 (14:54 +0200)
committerphcoder <phcoder@debian.bg45.phnet>
Sat, 10 Oct 2009 12:54:18 +0000 (14:54 +0200)
conf/mips.rmk
genmoddep.awk
kern/mips/dl.c

index b0a07819701ac12167596583be4203d3521a2c82..77eaa06cf76bb8cc253b4c661b79d23276242f30 100644 (file)
@@ -17,7 +17,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
        env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
        symbol.h term.h time.h types.h loader.h partition.h \
        msdos_partition.h machine/kernel.h handler.h list.h \
-       command.h machine/memory.h cpu/libgcc.h cpu/cache.h
+       command.h machine/memory.h cpu/libgcc.h cpu/cache.h cpu/dl.h
 
 symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
        /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
index af967ec07cd8626e5421455d6f48f4118a4107f4..f7f085e99018d6782df9554c8a3c894b6147aa3f 100644 (file)
@@ -29,7 +29,7 @@ FNR == 1 {
   if ($1 in symtab) {
     modtab[module] = modtab[module] " " symtab[$1];
   }
-  else if ($1 != "__gnu_local_gp"){
+  else {
     printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
     error++;
     exit;
index 504bb2ef558f5dff83820a008a7f178aa1ed0404..f8b11a3eb853b7781b9cd134d094e4e64be7b170 100644 (file)
@@ -21,6 +21,7 @@
 #include <grub/elf.h>
 #include <grub/misc.h>
 #include <grub/err.h>
+#include <grub/cpu/types.h>
 
 /* Check if EHDR is a valid ELF header.  */
 grub_err_t
@@ -29,9 +30,15 @@ grub_arch_dl_check_header (void *ehdr)
   Elf_Ehdr *e = ehdr;
 
   /* Check the magic numbers.  */
+#ifdef WORDS_BIGENDIAN
+  if (e->e_ident[EI_CLASS] != ELFCLASS32
+      || e->e_ident[EI_DATA] != ELFDATA2MSB
+      || e->e_machine != EM_MIPS)
+#else
   if (e->e_ident[EI_CLASS] != ELFCLASS32
       || e->e_ident[EI_DATA] != ELFDATA2LSB
-      || e->e_machine != EM_386)
+      || e->e_machine != EM_MIPS)
+#endif
     return grub_error (GRUB_ERR_BAD_OS, "invalid arch specific ELF magic");
 
   return GRUB_ERR_NONE;