commit-hurd
[Top][All Lists]
Advanced

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

hurd-l4 laden/ChangeLog laden/loader.c wortel/C...


From: Marcus Brinkmann
Subject: hurd-l4 laden/ChangeLog laden/loader.c wortel/C...
Date: Thu, 25 Sep 2003 08:39:21 -0400

CVSROOT:        /cvsroot/hurd
Module name:    hurd-l4
Branch:         
Changes by:     Marcus Brinkmann <address@hidden>       03/09/25 08:39:21

Modified files:
        laden          : ChangeLog loader.c 
        wortel         : ChangeLog loader.c 

Log message:
        laden/
        wortel/
        2003-09-25  Marcus Brinkmann  <address@hidden>
        
        * loader.c [HAVE_CONFIG_H]: Include <config.h>.
        (loader_elf_load): Rewritten architecture check of ELF binary,
        support PPC now.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/ChangeLog.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/loader.c.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/ChangeLog.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/loader.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: hurd-l4/laden/ChangeLog
diff -u hurd-l4/laden/ChangeLog:1.6 hurd-l4/laden/ChangeLog:1.7
--- hurd-l4/laden/ChangeLog:1.6 Wed Sep 24 20:29:14 2003
+++ hurd-l4/laden/ChangeLog     Thu Sep 25 08:39:20 2003
@@ -1,5 +1,11 @@
 2003-09-25  Marcus Brinkmann  <address@hidden>
 
+       * loader.c [HAVE_CONFIG_H]: Include <config.h>.
+       (loader_elf_load): Rewritten architecture check of ELF binary,
+       support PPC now.
+
+2003-09-25  Marcus Brinkmann  <address@hidden>
+
        * elf.h: Remove cruft.
 
 2003-09-21  Marco Gerards  <address@hidden>
Index: hurd-l4/laden/loader.c
diff -u hurd-l4/laden/loader.c:1.9 hurd-l4/laden/loader.c:1.10
--- hurd-l4/laden/loader.c:1.9  Fri Sep 19 14:50:12 2003
+++ hurd-l4/laden/loader.c      Thu Sep 25 08:39:20 2003
@@ -18,6 +18,10 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <string.h>
 
 #include "loader.h"
@@ -183,14 +187,28 @@
   if (!elf->e_phoff)
     panic ("%s has no valid program header offset", name);
 
-#ifdef i386
-  if (elf->e_ident[EI_CLASS] != ELFCLASS32
-      || elf->e_ident[EI_DATA] != ELFDATA2LSB
-      || elf->e_machine != EM_386)
-    panic ("%s is not for this architecture", name);
+  /* FIXME: Some architectures support both word sizes.  */
+  if (!((elf->e_ident[EI_CLASS] == ELFCLASS32
+        && L4_WORD_SIZE == 32)
+       || (elf->e_ident[EI_CLASS] == ELFCLASS64
+           && L4_WORD_SIZE == 64)))
+    panic ("%s has invalid word size", name);
+  if (!((elf->e_ident[EI_DATA] == ELFDATA2LSB
+        && L4_BYTE_ORDER == L4_LITTLE_ENDIAN)
+       || (elf->e_ident[EI_DATA] == ELFDATA2MSB
+           && L4_BYTE_ORDER == L4_BIG_ENDIAN)))
+    panic ("%s has invalid byte order", name);
+
+#if i386
+# define elf_machine EM_386
+#elif PPC
+# define elf_machine EM_PPC
 #else
-#error Not ported to this architecture!
+# error Not ported to this architecture!
 #endif
+
+  if (elf->e_machine != elf_machine)
+    panic ("%s is not for this architecture", name);
 
   for (i = 0; i < elf->e_phnum; i++)
     {
Index: hurd-l4/wortel/ChangeLog
diff -u hurd-l4/wortel/ChangeLog:1.5 hurd-l4/wortel/ChangeLog:1.6
--- hurd-l4/wortel/ChangeLog:1.5        Wed Sep 24 20:29:14 2003
+++ hurd-l4/wortel/ChangeLog    Thu Sep 25 08:39:20 2003
@@ -1,5 +1,11 @@
 2003-09-25  Marcus Brinkmann  <address@hidden>
 
+       * loader.c [HAVE_CONFIG_H]: Include <config.h>.
+       (loader_elf_load): Rewritten architecture check of ELF binary,
+       support PPC now.
+
+2003-09-25  Marcus Brinkmann  <address@hidden>
+
        * elf.h: Remove cruft.
 
 2003-09-21  Marco Gerards  <address@hidden>
Index: hurd-l4/wortel/loader.c
diff -u hurd-l4/wortel/loader.c:1.5 hurd-l4/wortel/loader.c:1.6
--- hurd-l4/wortel/loader.c:1.5 Tue Sep 16 15:24:05 2003
+++ hurd-l4/wortel/loader.c     Thu Sep 25 08:39:21 2003
@@ -18,6 +18,10 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <string.h>
 
 #include "loader.h"
@@ -182,14 +186,29 @@
   if (!elf->e_phoff)
     panic ("%s has no valid program header offset", name);
 
-#ifdef i386
-  if (elf->e_ident[EI_CLASS] != ELFCLASS32
-      || elf->e_ident[EI_DATA] != ELFDATA2LSB
-      || elf->e_machine != EM_386)
-    panic ("%s is not for this architecture", name);
+  /* FIXME: Some architectures support both word sizes.  */
+  if (!((elf->e_ident[EI_CLASS] == ELFCLASS32
+        && L4_WORDSIZE == 32)
+       || (elf->e_ident[EI_CLASS] == ELFCLASS64
+           && L4_WORDSIZE == 64)))
+    panic ("%s has invalid word size", name);
+
+  if (!((elf->e_ident[EI_DATA] == ELFDATA2LSB
+        && L4_BYTE_ORDER == L4_LITTLE_ENDIAN)
+       || (elf->e_ident[EI_DATA] == ELFDATA2MSB
+           && L4_BYTE_ORDER == L4_BIG_ENDIAN)))
+    panic ("%s has invalid byte order", name);
+
+#if i386
+# define elf_machine EM_386
+#elif PPC
+# define elf_machine EM_PPC
 #else
-#error Not ported to this architecture!
+# error Not ported to this architecture!
 #endif
+
+  if (elf->e_machine != elf_machine)
+    panic ("%s is not for this architecture", name);
 
   for (i = 0; i < elf->e_phnum; i++)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]