[ros-diffs] [arty] 28765: Ignore elf executables.

arty at svn.reactos.org arty at svn.reactos.org
Sun Sep 2 13:10:28 CEST 2007


Author: arty
Date: Sun Sep  2 15:10:27 2007
New Revision: 28765

URL: http://svn.reactos.org/svn/reactos?rev=28765&view=rev
Log:
Ignore elf executables.

Modified:
    trunk/reactos/tools/pefixup.c

Modified: trunk/reactos/tools/pefixup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/pefixup.c?rev=28765&r1=28764&r2=28765&view=diff
==============================================================================
--- trunk/reactos/tools/pefixup.c (original)
+++ trunk/reactos/tools/pefixup.c Sun Sep  2 15:10:27 2007
@@ -229,6 +229,7 @@
 {
    int fd_in, fd_out;
    long len;
+   char hdrbuf[4] = { }, elfhdr[4] = { '\177', 'E', 'L', 'F' };
    PIMAGE_SECTION_HEADER section_header;
    PIMAGE_DATA_DIRECTORY data_dir;
    unsigned int i;
@@ -276,6 +277,13 @@
       printf("Can't open input file.\n");
       return 1;
    }
+
+   /*
+    * PowerPC ReactOS uses elf, so doesn't need pefixup
+    */
+   len = read(fd_in, hdrbuf, sizeof(elfhdr));
+   if (!memcmp(hdrbuf, elfhdr, sizeof(elfhdr)))
+      return 0;
 
    len = lseek(fd_in, 0, SEEK_END);
    if (len < sizeof(IMAGE_DOS_HEADER))




More information about the Ros-diffs mailing list