emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112108: * src/unexcw.c: Update for x


From: Ken Brown
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112108: * src/unexcw.c: Update for x86_64-cygwin.
Date: Fri, 22 Mar 2013 12:52:31 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112108
committer: Ken Brown <address@hidden>
branch nick: trunk
timestamp: Fri 2013-03-22 12:52:31 -0400
message:
  * src/unexcw.c: Update for x86_64-cygwin.
  
  Drop unneeded inclusion of w32common.h.
  (report_sheap_usage): Declare.
  (read_exe_header): Add magic numbers for x86_64.
  (fixup_executable): Fix printf format specifier for unsigned long
  argument.
modified:
  src/ChangeLog
  src/unexcw.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-03-22 12:41:34 +0000
+++ b/src/ChangeLog     2013-03-22 16:52:31 +0000
@@ -1,3 +1,11 @@
+2013-03-22  Ken Brown  <address@hidden>
+
+       * unexcw.c: Drop unneeded inclusion of w32common.h.
+       (report_sheap_usage): Declare.
+       (read_exe_header): Add magic numbers for x86_64.
+       (fixup_executable): Fix printf format specifier for unsigned long
+       argument.
+
 2013-03-22  Dmitry Antipov  <address@hidden>
 
        * frame.h (struct frame): Put menu_bar_window under #ifdef

=== modified file 'src/unexcw.c'
--- a/src/unexcw.c      2013-01-02 16:13:04 +0000
+++ b/src/unexcw.c      2013-03-22 16:52:31 +0000
@@ -20,7 +20,6 @@
 
 #include <config.h>
 #include "unexec.h"
-#include "w32common.h"
 
 #include <lisp.h>
 #include <stdio.h>
@@ -31,6 +30,8 @@
 
 #define DOTEXE ".exe"
 
+extern void report_sheap_usage (int);
+
 extern int bss_sbrk_did_unexec;
 
 extern int __malloc_initialized;
@@ -73,7 +74,11 @@
 
   assert (exe_header_buffer->file_header.e_magic == 0x5a4d);
   assert (exe_header_buffer->file_header.nt_signature == 0x4550);
+#ifdef __x86_64__
+  assert (exe_header_buffer->file_header.f_magic == 0x8664);
+#else
   assert (exe_header_buffer->file_header.f_magic == 0x014c);
+#endif
   assert (exe_header_buffer->file_header.f_nscns > 0);
   assert (exe_header_buffer->file_header.f_nscns <=
          sizeof (exe_header_buffer->section_header) /
@@ -85,7 +90,11 @@
          sizeof (exe_header_buffer->file_optional_header));
   assert (ret == sizeof (exe_header_buffer->file_optional_header));
 
+#ifdef __x86_64__
+  assert (exe_header_buffer->file_optional_header.magic == 0x020b);
+#else
   assert (exe_header_buffer->file_optional_header.magic == 0x010b);
+#endif
 
   for (i = 0; i < exe_header_buffer->file_header.f_nscns; ++i)
     {
@@ -132,7 +141,7 @@
        exe_header->file_optional_header.ImageBase +
        exe_header->section_header[i].s_paddr;
       if (debug_unexcw)
-       printf ("%8s start 0x%08x end 0x%08x\n",
+       printf ("%8s start %#lx end %#lx\n",
                exe_header->section_header[i].s_name,
                start_address, end_address);
       if (my_edata >= (char *) start_address
@@ -149,7 +158,7 @@
          assert (ret == my_edata - (char *) start_address);
          ++found_data;
          if (debug_unexcw)
-           printf ("         .data, mem start 0x%08x mem length %d\n",
+           printf ("         .data, mem start %#lx mem length %d\n",
                    start_address, my_edata - (char *) start_address);
          if (debug_unexcw)
            printf ("         .data, file start %d file length %d\n",
@@ -233,7 +242,7 @@
          __malloc_initialized = 1;
          assert (ret == (my_endbss - (char *) start_address));
          if (debug_unexcw)
-           printf ("         .bss, mem start 0x%08x mem length %d\n",
+           printf ("         .bss, mem start %#lx mem length %d\n",
                    start_address, my_endbss - (char *) start_address);
          if (debug_unexcw)
            printf ("         .bss, file start %d file length %d\n",


reply via email to

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